From 6de513cef43ad83ecd1823bde5a4e05c22224b0f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 12 Jun 2000 06:09:39 +0000 Subject: fixed a bug in BlockSignals() for systems that don't have sigprocmask() (This used to be commit abf06fa90ba49f6a1ec5458d056f8b8cf20b6512) --- source3/lib/signal.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/source3/lib/signal.c b/source3/lib/signal.c index 5651e942d7..9c78fad886 100644 --- a/source3/lib/signal.c +++ b/source3/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? */ -- cgit