svn commit: samba r15509 - branches/SAMBA_3_0/source/lib trunk/source/lib

jpeach at samba.org jpeach at samba.org
Mon May 8 03:28:27 GMT 2006


Author: jpeach
Date: 2006-05-08 03:28:26 +0000 (Mon, 08 May 2006)
New Revision: 15509

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=15509

Log:
Preserve errno in fcntl lock wrappers.

Modified:
   branches/SAMBA_3_0/source/lib/util.c
   trunk/source/lib/util.c


Changeset:
Modified: branches/SAMBA_3_0/source/lib/util.c
===================================================================
--- branches/SAMBA_3_0/source/lib/util.c	2006-05-08 03:20:49 UTC (rev 15508)
+++ branches/SAMBA_3_0/source/lib/util.c	2006-05-08 03:28:26 UTC (rev 15509)
@@ -1960,8 +1960,10 @@
 	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 @@
 	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;
 	}
 

Modified: trunk/source/lib/util.c
===================================================================
--- trunk/source/lib/util.c	2006-05-08 03:20:49 UTC (rev 15508)
+++ trunk/source/lib/util.c	2006-05-08 03:28:26 UTC (rev 15509)
@@ -1960,8 +1960,10 @@
 	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 @@
 	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;
 	}
 



More information about the samba-cvs mailing list