summaryrefslogtreecommitdiff
path: root/source3/lib/util.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2002-04-19 02:08:52 +0000
committerJeremy Allison <jra@samba.org>2002-04-19 02:08:52 +0000
commit302b581ddc1f9dcee5c1bcb32da558ae2a7b24c1 (patch)
treef552ee1a194744889de11e042692cd7efe0212fa /source3/lib/util.c
parentdcb572e0b26858f58ddcf5cac1c94be31cda844d (diff)
downloadsamba-302b581ddc1f9dcee5c1bcb32da558ae2a7b24c1.tar.gz
samba-302b581ddc1f9dcee5c1bcb32da558ae2a7b24c1.tar.bz2
samba-302b581ddc1f9dcee5c1bcb32da558ae2a7b24c1.zip
First cut at fix for the EINTR problem... More needs to be done I think.
Jeremy. (This used to be commit 48475a7a697242b9fd7b1aec24389afb112569c4)
Diffstat (limited to 'source3/lib/util.c')
-rw-r--r--source3/lib/util.c9
1 files changed, 5 insertions, 4 deletions
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 */