From 302b581ddc1f9dcee5c1bcb32da558ae2a7b24c1 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 19 Apr 2002 02:08:52 +0000 Subject: First cut at fix for the EINTR problem... More needs to be done I think. Jeremy. (This used to be commit 48475a7a697242b9fd7b1aec24389afb112569c4) --- source3/lib/util.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'source3/lib/util.c') diff --git a/source3/lib/util.c b/source3/lib/util.c index 7e2ad49639..c524adaa7a 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -1353,11 +1353,12 @@ BOOL fcntl_lock(int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type) lock.l_len = count; lock.l_pid = 0; - errno = 0; + do { + errno = 0; + ret = fcntl(fd,op,&lock); + } while (ret == -1 && errno == EINTR); - ret = fcntl(fd,op,&lock); - - if (errno != 0) + if (ret == -1 && errno != 0) DEBUG(3,("fcntl_lock: fcntl lock gave errno %d (%s)\n",errno,strerror(errno))); /* a lock query */ -- cgit