summaryrefslogtreecommitdiffstats
path: root/source/lib/signal.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2000-06-12 06:09:39 +0000
committerAndrew Tridgell <tridge@samba.org>2000-06-12 06:09:39 +0000
commitabf06fa90ba49f6a1ec5458d056f8b8cf20b6512 (patch)
treeb02553f7a8dc1df850b7c51791162e3e0f1bc2f6 /source/lib/signal.c
parent02577ab7d275dfb49e104f3358cb3caa66b3b09e (diff)
downloadsamba-abf06fa90ba49f6a1ec5458d056f8b8cf20b6512.tar.gz
samba-abf06fa90ba49f6a1ec5458d056f8b8cf20b6512.tar.xz
samba-abf06fa90ba49f6a1ec5458d056f8b8cf20b6512.zip
fixed a bug in BlockSignals() for systems that don't have
sigprocmask()
Diffstat (limited to 'source/lib/signal.c')
-rw-r--r--source/lib/signal.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/source/lib/signal.c b/source/lib/signal.c
index 5651e942d78..9c78fad8862 100644
--- a/source/lib/signal.c
+++ b/source/lib/signal.c
@@ -75,12 +75,10 @@ void BlockSignals(BOOL block,int signum)
sigaddset(&set,signum);
sigprocmask(block?SIG_BLOCK:SIG_UNBLOCK,&set,NULL);
#elif defined(HAVE_SIGBLOCK)
- int block_mask = sigmask(signum);
- static int oldmask = 0;
if (block) {
- oldmask = sigblock(block_mask);
+ sigblock(sigmask(signum));
} else {
- sigsetmask(oldmask);
+ sigsetmask(siggetmask() & ~sigmask(signum));
}
#else
/* yikes! This platform can't block signals? */