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 | d179b191794c06626375692ea81c1931db57f550 (patch) | |
tree | d3b2b2a25d01a7a4c085c5ef8fa24031e62dc03d /source3/lib/util_file.c | |
parent | 824375e310b5af41a12443aace9ab18c5a2ff647 (diff) | |
download | samba-d179b191794c06626375692ea81c1931db57f550.tar.gz samba-d179b191794c06626375692ea81c1931db57f550.tar.xz samba-d179b191794c06626375692ea81c1931db57f550.zip |
Ensure we save any older SIGALRM signal handler.
Jeremy.
(This used to be commit aa0a6f5532a2689409426eef9a4b66a28fb97635)
Diffstat (limited to 'source3/lib/util_file.c')
-rw-r--r-- | source3/lib/util_file.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source3/lib/util_file.c b/source3/lib/util_file.c index fd3aeb99d9..883827a4f5 100644 --- a/source3/lib/util_file.c +++ b/source3/lib/util_file.c @@ -40,9 +40,10 @@ BOOL do_file_lock(int fd, int waitsecs, int type) { SMB_STRUCT_FLOCK lock; int ret; + void (*oldsig_handler)(int); gotalarm = 0; - CatchSignal(SIGALRM, SIGNAL_CAST gotalarm_sig); + oldsig_handler = CatchSignal(SIGALRM, SIGNAL_CAST gotalarm_sig); lock.l_type = type; lock.l_whence = SEEK_SET; @@ -54,7 +55,7 @@ BOOL do_file_lock(int fd, int waitsecs, int type) /* Note we must *NOT* use sys_fcntl here ! JRA */ ret = fcntl(fd, SMB_F_SETLKW, &lock); alarm(0); - CatchSignal(SIGALRM, SIGNAL_CAST SIG_IGN); + CatchSignal(SIGALRM, SIGNAL_CAST oldsig_handler); if (gotalarm) { DEBUG(0, ("do_file_lock: failed to %s file.\n", |