svn commit: samba r14726 - in trunk/source/locking: .

jra at samba.org jra at samba.org
Sat Mar 25 19:35:56 GMT 2006


Author: jra
Date: 2006-03-25 19:35:55 +0000 (Sat, 25 Mar 2006)
New Revision: 14726

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

Log:
Fix double-negative change on is_posix_locked.
Jeremy.

Modified:
   trunk/source/locking/brlock.c
   trunk/source/locking/locking.c


Changeset:
Modified: trunk/source/locking/brlock.c
===================================================================
--- trunk/source/locking/brlock.c	2006-03-25 19:12:08 UTC (rev 14725)
+++ trunk/source/locking/brlock.c	2006-03-25 19:35:55 UTC (rev 14726)
@@ -1038,6 +1038,7 @@
 
 /****************************************************************************
  Test if we could add a lock if we wanted to.
+ Returns True if the region required is currently unlocked, False if locked.
 ****************************************************************************/
 
 BOOL brl_locktest(struct byte_range_lock *br_lck,
@@ -1085,6 +1086,9 @@
 		DEBUG(10,("brl_locktest: posix start=%.0f len=%.0f %s for fnum %d file %s\n",
 			(double)start, (double)size, ret ? "locked" : "unlocked",
 			fsp->fnum, fsp->fsp_name ));
+
+		/* We need to return the inverse of is_posix_locked. */
+		ret = !ret;
         }
 
 	/* no conflicts - we could have added it */

Modified: trunk/source/locking/locking.c
===================================================================
--- trunk/source/locking/locking.c	2006-03-25 19:12:08 UTC (rev 14725)
+++ trunk/source/locking/locking.c	2006-03-25 19:35:55 UTC (rev 14726)
@@ -104,7 +104,7 @@
 			if (!br_lck) {
 				return False;
 			}
-			ret = brl_locktest(br_lck,
+			ret = !brl_locktest(br_lck,
 					global_smbpid,
 					procid_self(),
 					offset,
@@ -118,7 +118,7 @@
 		if (!br_lck) {
 			return False;
 		}
-		ret = brl_locktest(br_lck,
+		ret = !brl_locktest(br_lck,
 				global_smbpid,
 				procid_self(),
 				offset,



More information about the samba-cvs mailing list