summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Peach <jpeach@samba.org>2006-05-08 03:28:26 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:16:55 -0500
commita51ce2bfbe6222713a016b955bb21cd5946ac462 (patch)
tree124a92efda3bb5c2eea44cf23267a217a6bd7782
parent826614ed16e0fb23d30305990dbfa357b4366de2 (diff)
downloadsamba-a51ce2bfbe6222713a016b955bb21cd5946ac462.tar.gz
samba-a51ce2bfbe6222713a016b955bb21cd5946ac462.tar.bz2
samba-a51ce2bfbe6222713a016b955bb21cd5946ac462.zip
r15509: Preserve errno in fcntl lock wrappers.
(This used to be commit 624318245fbd4060617d9404700a04df23d667ac)
-rw-r--r--source3/lib/util.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index fd48cbfa83..d705901244 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -1960,8 +1960,10 @@ BOOL fcntl_lock(int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type)
ret = sys_fcntl_ptr(fd,op,&lock);
if (ret == -1) {
+ int sav = errno;
DEBUG(3,("fcntl_lock: lock failed at offset %.0f count %.0f op %d type %d (%s)\n",
(double)offset,(double)count,op,type,strerror(errno)));
+ errno = sav;
return False;
}
@@ -1995,8 +1997,10 @@ BOOL fcntl_getlock(int fd, SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pi
ret = sys_fcntl_ptr(fd,SMB_F_GETLK,&lock);
if (ret == -1) {
+ int sav = errno;
DEBUG(3,("fcntl_getlock: lock request failed at offset %.0f count %.0f type %d (%s)\n",
(double)*poffset,(double)*pcount,*ptype,strerror(errno)));
+ errno = sav;
return False;
}