summaryrefslogtreecommitdiff
path: root/source3/lib/util_file.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/util_file.c')
-rw-r--r--source3/lib/util_file.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/source3/lib/util_file.c b/source3/lib/util_file.c
index 611e0e40be..e80267f84b 100644
--- a/source3/lib/util_file.c
+++ b/source3/lib/util_file.c
@@ -40,10 +40,9 @@ BOOL do_file_lock(int fd, int waitsecs, int type)
{
SMB_STRUCT_FLOCK lock;
int ret;
- void (*oldsig_handler)(int);
gotalarm = 0;
- oldsig_handler = CatchSignal(SIGALRM, SIGNAL_CAST gotalarm_sig);
+ CatchSignal(SIGALRM, SIGNAL_CAST gotalarm_sig);
lock.l_type = type;
lock.l_whence = SEEK_SET;
@@ -52,10 +51,9 @@ BOOL do_file_lock(int fd, int waitsecs, int type)
lock.l_pid = 0;
alarm(waitsecs);
- /* Note we must *NOT* use sys_fcntl here ! JRA */
ret = fcntl(fd, SMB_F_SETLKW, &lock);
alarm(0);
- CatchSignal(SIGALRM, SIGNAL_CAST oldsig_handler);
+ CatchSignal(SIGALRM, SIGNAL_CAST SIG_IGN);
if (gotalarm) {
DEBUG(0, ("do_file_lock: failed to %s file.\n",
@@ -450,8 +448,7 @@ void *map_file(char *fname, size_t size)
#endif
if (!p) {
p = file_load(fname, &s2);
- if (!p) return NULL;
- if (s2 != size) {
+ if (!p || s2 != size) {
DEBUG(1,("incorrect size for %s - got %d expected %d\n",
fname, s2, size));
if (p) free(p);