]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
r15509: Preserve errno in fcntl lock wrappers.
authorJames Peach <jpeach@samba.org>
Mon, 8 May 2006 03:28:26 +0000 (03:28 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:16:55 +0000 (11:16 -0500)
(This used to be commit 624318245fbd4060617d9404700a04df23d667ac)

source3/lib/util.c

index fd48cbfa8382ac0c5340b5ff12b263adc151b8d5..d705901244ac3750e35c9a29e70c95f9856a0ff0 100644 (file)
@@ -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;
        }