From 87dd54d8c55f71d2faf35d968a6a6d3ce8cd0c39 Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Tue, 8 Apr 2003 23:55:53 +0000
Subject: [PATCH] Test multiple locks of same region from same process/thread.

---
 src/xpdev/wraptest.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/xpdev/wraptest.c b/src/xpdev/wraptest.c
index 3f54f5d7c9..49e0993efd 100644
--- a/src/xpdev/wraptest.c
+++ b/src/xpdev/wraptest.c
@@ -91,10 +91,14 @@ int main()
 		return(errno);
 	}
 	write(fd,"lock testing\n",LOCK_LEN);
-	if(lock(fd,LOCK_OFFSET,LOCK_LEN))
+	if(lock(fd,LOCK_OFFSET,LOCK_LEN)==0)
+		printf("lock() succeeds\n");
+	else
 		printf("!FAILURE lock() non-functional (or file already locked)\n");
+	if(lock(fd,LOCK_OFFSET,LOCK_LEN)==0)
+		printf("Subsequent lock succeeded\n");
 	else
-		printf("lock() succeeds\n");
+		perror("!Subsequent lock of "LOCK_FNAME);
 	if(_beginthread(
 		  lock_test_thread	/* entry point */
 		 ,0  				/* stack size (0=auto) */
-- 
GitLab