diff options
author | gendalia <gendalia@pkgsrc.org> | 2005-05-27 15:51:35 +0000 |
---|---|---|
committer | gendalia <gendalia@pkgsrc.org> | 2005-05-27 15:51:35 +0000 |
commit | 1fe90be6f92bd3234fdfd22da0cf8cd686fae73b (patch) | |
tree | b32fed73659d883307e0f7e8fd1ea31df7db33b8 /net | |
parent | 75a47e41dd9e97cd6b87f775bf039fedc68434f5 (diff) | |
download | pkgsrc-1fe90be6f92bd3234fdfd22da0cf8cd686fae73b.tar.gz |
Work around sigwait not getting signals from pthread_kill
Diffstat (limited to 'net')
-rw-r--r-- | net/openafs/patches/patch-ag | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/net/openafs/patches/patch-ag b/net/openafs/patches/patch-ag new file mode 100644 index 00000000000..72eb735a777 --- /dev/null +++ b/net/openafs/patches/patch-ag @@ -0,0 +1,72 @@ +$NetBSD: patch-ag,v 1.1 2005/05/27 15:51:35 gendalia Exp $ + +sigwait doesn't get signals from pthread_kill + +--- src/util/softsig.c.orig 2005-05-27 10:47:01.000000000 -0500 ++++ src/util/softsig.c +@@ -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); + } |