diff options
author | Andrew Tridgell <tridge@samba.org> | 2000-06-12 06:09:39 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2000-06-12 06:09:39 +0000 |
commit | abf06fa90ba49f6a1ec5458d056f8b8cf20b6512 (patch) | |
tree | b02553f7a8dc1df850b7c51791162e3e0f1bc2f6 | |
parent | 02577ab7d275dfb49e104f3358cb3caa66b3b09e (diff) | |
download | samba-abf06fa90ba49f6a1ec5458d056f8b8cf20b6512.tar.gz samba-abf06fa90ba49f6a1ec5458d056f8b8cf20b6512.tar.xz samba-abf06fa90ba49f6a1ec5458d056f8b8cf20b6512.zip |
fixed a bug in BlockSignals() for systems that don't have
sigprocmask()
-rw-r--r-- | source/lib/signal.c | 6 |
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? */ |