summaryrefslogtreecommitdiff
path: root/source3/lib/util.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1996-08-15 15:11:34 +0000
committerAndrew Tridgell <tridge@samba.org>1996-08-15 15:11:34 +0000
commit47673b32ed4a907b380b70d5f4f366ba8be301d2 (patch)
tree384a13167ec3b96d217acce3e6add82e391d1246 /source3/lib/util.c
parent7ea7a3361320c4c25e6bb80c1ed763c229fa541a (diff)
downloadsamba-47673b32ed4a907b380b70d5f4f366ba8be301d2.tar.gz
samba-47673b32ed4a907b380b70d5f4f366ba8be301d2.tar.bz2
samba-47673b32ed4a907b380b70d5f4f366ba8be301d2.zip
- added FAST_SHARE_MODES code
- added some named pipe code from Jim (This used to be commit c94866e9e44ea1eb72da06bc65ef1c032ae8e0c9)
Diffstat (limited to 'source3/lib/util.c')
-rw-r--r--source3/lib/util.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index 413f1c648e..5b765e0ac6 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -3118,16 +3118,20 @@ char *gidtoname(int gid)
/*******************************************************************
block sigs
********************************************************************/
-void BlockSignals(BOOL block)
+void BlockSignals(BOOL block,int signum)
{
#ifdef USE_SIGBLOCK
- int block_mask = (sigmask(SIGTERM)|sigmask(SIGQUIT)|sigmask(SIGSEGV)
- |sigmask(SIGCHLD)|sigmask(SIGQUIT)|sigmask(SIGBUS)|
- sigmask(SIGINT));
+ int block_mask = sigmask(signum);
+ static int oldmask = 0;
if (block)
- sigblock(block_mask);
+ oldmask = sigblock(block_mask);
else
- sigsetmask(0);
+ sigsetmask(oldmask);
+#elif defined(USE_SIGPROCMASK)
+ sigset_t set;
+ sigemptyset(&set);
+ sigaddset(&set,signum);
+ sigprocmask(block?SIG_BLOCK:SIG_UNBLOCK,&set,NULL);
#endif
}