diff options
author | Jeremy Allison <jra@samba.org> | 2002-06-13 22:49:13 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2002-06-13 22:49:13 +0000 |
commit | aa0a6f5532a2689409426eef9a4b66a28fb97635 (patch) | |
tree | 82e9cd271983a381690ba3d5449dacf0ab6ff824 /source/lib/messages.c | |
parent | 1712a7b34a73ad89965961c0db4dd198d6b257c6 (diff) | |
download | samba-aa0a6f5532a2689409426eef9a4b66a28fb97635.tar.gz samba-aa0a6f5532a2689409426eef9a4b66a28fb97635.tar.xz samba-aa0a6f5532a2689409426eef9a4b66a28fb97635.zip |
Ensure we save any older SIGALRM signal handler.
Jeremy.
Diffstat (limited to 'source/lib/messages.c')
-rw-r--r-- | source/lib/messages.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/lib/messages.c b/source/lib/messages.c index 3929f526dc1..5d861b485cf 100644 --- a/source/lib/messages.c +++ b/source/lib/messages.c @@ -475,6 +475,7 @@ BOOL message_named_mutex(char *name, unsigned int timeout) { TDB_DATA key; int ret; + void (*oldsig_handler)(int); if (!message_init()) return False; @@ -484,7 +485,7 @@ BOOL message_named_mutex(char *name, unsigned int timeout) if (timeout) { gotalarm = 0; - CatchSignal(SIGALRM, SIGNAL_CAST gotalarm_sig); + oldsig_handler = CatchSignal(SIGALRM, SIGNAL_CAST gotalarm_sig); alarm(timeout); } @@ -492,7 +493,7 @@ BOOL message_named_mutex(char *name, unsigned int timeout) if (timeout) { alarm(0); - CatchSignal(SIGALRM, SIGNAL_CAST SIG_IGN); + CatchSignal(SIGALRM, SIGNAL_CAST oldsig_handler); if (gotalarm) return False; } |