diff options
author | gendalia <gendalia> | 2005-05-27 15:51:35 +0000 |
---|---|---|
committer | gendalia <gendalia> | 2005-05-27 15:51:35 +0000 |
commit | 5e96f19cdb8d150bdb721c1aaf03ac85934d24e0 (patch) | |
tree | b32fed73659d883307e0f7e8fd1ea31df7db33b8 /net | |
parent | 623ef291130fe0f37f073affeeb0b5d5a1b93f27 (diff) | |
download | pkgsrc-5e96f19cdb8d150bdb721c1aaf03ac85934d24e0.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); + } |