]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Fix the retry mechanism on file locks.
authordrh <drh@noemail.net>
Tue, 11 Aug 2015 18:18:24 +0000 (18:18 +0000)
committerdrh <drh@noemail.net>
Tue, 11 Aug 2015 18:18:24 +0000 (18:18 +0000)
FossilOrigin-Name: 600df309fc547db3dc21cfc41609eb3dcaa67273

manifest
manifest.uuid
src/os_unix.c

index d335be7650577b30cdd8e7423be90fd5dbca45bb..d9b48e52e18dacc09550d2e3add4bacde060b720 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Merge\sall\srecent\strunk\senhancements\sand\sfixes\sinto\sthe\sapple-osx\sbranch.
-D 2015-04-20T01:25:56.443
+C Fix\sthe\sretry\smechanism\son\sfile\slocks.
+D 2015-08-11T18:18:24.400
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in 0dc7ac539680061505b2a3516299ae9a7e4595cd
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -217,7 +217,7 @@ F src/os.c 5822c2b843a77219bba1e28887cdc816b27ca29d
 F src/os.h 3e57a24e2794a94d3cf2342c6d9a884888cd96bf
 F src/os_common.h 92815ed65f805560b66166e3583470ff94478f04
 F src/os_setup.h c9d4553b5aaa6f73391448b265b89bed0b890faa
-F src/os_unix.c acd575b6c0dc94afe3a5a21cf789ca1793261feb
+F src/os_unix.c bc57de77a1317cb613e31898bfd6667ec41b39ed
 F src/os_win.c 93f8662844dc935280a1851d15c823f1e6857408
 F src/os_win.h eb7a47aa17b26b77eb97e4823f20a00b8bda12ca
 F src/pager.c 694caffb16891a96608193968d7c9a8fa9a71240
@@ -1256,7 +1256,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P bfc7142ad295c4b04078f9c01030bdbd15f024e8 592c010478fba7410424f011a62e019c826f1ac3
-R 65a49022ceca7cc6e1f2dfc581f9ff77
+P 74b7bf17446bc21a73fa5b75c2942b5660b0ad7e
+R 0cb9b5a75b63fcc8106511860d2fb929
 U drh
-Z 2ba0195ba41fcb8cc4ac8903189d5cd1
+Z 1b4c808f8bf036ac70f368df20dfe359
index 8c2c4796ad501978083c408511462659ae92aaf4..2c4d2fcb8588b82d29f49d59b604ad31a7f8f936 100644 (file)
@@ -1 +1 @@
-74b7bf17446bc21a73fa5b75c2942b5660b0ad7e
\ No newline at end of file
+600df309fc547db3dc21cfc41609eb3dcaa67273
\ No newline at end of file
index 0b88d273543f6f4479f33e89415546bc47de5668..3171655d21b74ccf6fd48f802a23c43f5cd247cf 100644 (file)
@@ -1775,12 +1775,14 @@ static int unixFileLock(unixFile *pFile, struct flock *pLock, int nRetry){
     }
   }else{
     int i = 0;                      
-    do {
+    for(;;){
       rc = osFcntl(pFile->h, F_SETLK, pLock);
-      if( rc && nRetry ){
-         usleep(100 * (++i));
+      if( rc && nRetry-- ){
+        usleep(100 * (++i));
+      }else{
+        break;
       }
-    }while( !rc && nRetry-- );
+    }
   }
   return rc;
 }