]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE14-netbsd-fileserver-shutdown-20050601
authorTracy Di Marco White <gendalia@netbsd.org>
Thu, 2 Jun 2005 05:41:30 +0000 (05:41 +0000)
committerDerrick Brashear <shadow@dementia.org>
Thu, 2 Jun 2005 05:41:30 +0000 (05:41 +0000)
FIXES 16897

do what we do on darwin

(cherry picked from commit ab0f8ed43b863aeccbb98c8beae545cfeb40ee36)

src/util/softsig.c

index 42044cbad3a2c9f602e38ad3c9eafb408c8be385..73e2e6f96d06f223998a546b248d63005dd2b4bb 100644 (file)
@@ -36,9 +36,9 @@ static pthread_t softsig_tid;
 static struct {
     void (*handler) (int);
     int pending;
-#if !defined(AFS_DARWIN60_ENV)
+#if !defined(AFS_DARWIN60_ENV) || !defined(AFS_NBSD_ENV)
     int fatal;
-#endif /* !defined(AFS_DARWIN60_ENV) */
+#endif /* !defined(AFS_DARWIN60_ENV) || !defined(AFS_NBSD_ENV) */
     int inited;
 } softsig_sigs[NSIG];
 
@@ -53,17 +53,17 @@ softsig_thread(void *arg)
     pthread_sigmask(SIG_BLOCK, &ss, &os);
     pthread_sigmask(SIG_SETMASK, &os, NULL);
     sigaddset(&ss, SIGUSR1);
-#if defined(AFS_DARWIN60_ENV)
+#if defined(AFS_DARWIN60_ENV) || defined(AFS_NBSD_ENV)
     pthread_sigmask (SIG_BLOCK, &ss, NULL);
     sigdelset (&os, SIGUSR1);
-#else /* !defined(AFS_DARWIN60_ENV) */
+#else /* !defined(AFS_DARWIN60_ENV) && !defined(AFS_NBSD_ENV) */
     for (i = 0; i < NSIG; i++) {
        if (!sigismember(&os, i) && i != SIGSTOP && i != SIGKILL) {
            sigaddset(&ss, i);
            softsig_sigs[i].fatal = 1;
        }
     }
-#endif /* defined(AFS_DARWIN60_ENV) */
+#endif /* defined(AFS_DARWIN60_ENV) || defined(AFS_NBSD_ENV) */
 
     while (1) {
        void (*h) (int);
@@ -74,10 +74,10 @@ softsig_thread(void *arg)
        for (i = 0; i < NSIG; i++) {
            if (softsig_sigs[i].handler && !softsig_sigs[i].inited) {
                sigaddset(&ss, i);
-#if defined(AFS_DARWIN60_ENV)
+#if defined(AFS_DARWIN60_ENV) || defined(AFS_NBSD_ENV)
                pthread_sigmask (SIG_BLOCK, &ss, NULL);
                sigdelset (&os, i);
-#endif /* defined(AFS_DARWIN60_ENV) */
+#endif /* defined(AFS_DARWIN60_ENV) || defined(AFS_NBSD_ENV) */
                softsig_sigs[i].inited = 1;
            }
            if (softsig_sigs[i].pending) {
@@ -87,16 +87,16 @@ softsig_thread(void *arg)
            }
        }
        if (i == NSIG) {
-#if defined(AFS_DARWIN60_ENV)
+#if defined(AFS_DARWIN60_ENV) || defined(AFS_NBSD_ENV)
            sigsuspend (&os);
-#else /* !defined(AFS_DARWIN60_ENV) */
+#else /* !defined(AFS_DARWIN60_ENV) && !defined(AFS_NBSD_ENV) */
            sigwait(&ss, &sigw);
            if (sigw != SIGUSR1) {
                if (softsig_sigs[sigw].fatal)
                    exit(0);
                softsig_sigs[sigw].pending = 1;
            }
-#endif /* defined(AFS_DARWIN60_ENV) */
+#endif /* defined(AFS_DARWIN60_ENV) || defined(AFS_NBSD_ENV) */
        } else if (h)
            h(i);
     }