]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
In the windows VFS, make sure we do not return an error if attempting
authordrh <drh@noemail.net>
Wed, 7 Nov 2007 01:19:07 +0000 (01:19 +0000)
committerdrh <drh@noemail.net>
Wed, 7 Nov 2007 01:19:07 +0000 (01:19 +0000)
to delete a file that does not exist. (CVS 4532)

FossilOrigin-Name: 08a685abc149cd29c3595a61c9bc1a04e6d95c4d

manifest
manifest.uuid
src/os_win.c

index b0837b547e23435f299a19309c94638f07445a41..eb60a60d980e39099dea4c69fdeda5713d6f1428 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Version\s3.5.2\s(CVS\s4531)
-D 2007-11-05T20:49:21
+C In\sthe\swindows\sVFS,\smake\ssure\swe\sdo\snot\sreturn\san\serror\sif\sattempting\nto\sdelete\sa\sfile\sthat\sdoes\snot\sexist.\s(CVS\s4532)
+D 2007-11-07T01:19:07
 F Makefile.in 30c7e3ba426ddb253b8ef037d1873425da6009a8
 F Makefile.linux-gcc 65241babba6faf1152bf86574477baab19190499
 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
@@ -119,7 +119,7 @@ F src/os_test.c 49833426101f99aee4bb5f6a44b7c4b2029fda1c
 F src/os_test.h 903c93554c23d88f34f667f1979e4a1cee792af3
 F src/os_unix.c db6755454c84004d0041eb1b2194c90b35db0a5b
 F src/os_unix.h 5768d56d28240d3fe4537fac08cc85e4fb52279e
-F src/os_win.c fe8f2d8fc3a010a2e9d4a0acbdcf4981522cac7b
+F src/os_win.c 81690a858b90a1e0b83e7afbce6b6498bb3d3a1d
 F src/os_win.h 41a946bea10f61c158ce8645e7646b29d44f122b
 F src/pager.c c5ffa55c299663b579fbcb430752c1e79d302c5b
 F src/pager.h d783e7f184afdc33adff37ba58d4e029bd8793b3
@@ -584,7 +584,7 @@ F www/tclsqlite.tcl 8be95ee6dba05eabcd27a9d91331c803f2ce2130
 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
 F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
 F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5
-P b985328ad98669cbf2fb9a56b015a1db35657004
-R 045acfab3b69ad15684e6d98cc0cde64
+P 60da01630ab3668541aea7d303fc5d52fe3ee281
+R 7ccf0aa6904afb1d48146bf503fba144
 U drh
-Z 07d5a7ae440a197103a6adf74b52b41d
+Z 00cca131396f556941a71f0d631fd420
index 24652527be61ffaf072586a9b15d084b9e50d6ec..44150f44f0847f18eed983db05019a3b00798233 100644 (file)
@@ -1 +1 @@
-60da01630ab3668541aea7d303fc5d52fe3ee281
\ No newline at end of file
+08a685abc149cd29c3595a61c9bc1a04e6d95c4d
\ No newline at end of file
index ebaee493289d978cb795ee4d1b5f1441883ee04b..d2a55305d95eb498900023c80db1b57308512789 100644 (file)
@@ -1188,13 +1188,13 @@ static int winOpen(
 ** Note that windows does not allow a file to be deleted if some other
 ** process has it open.  Sometimes a virus scanner or indexing program
 ** will open a journal file shortly after it is created in order to do
-** whatever it is it does.  While this other process is holding the
+** whatever does.  While this other process is holding the
 ** file open, we will be unable to delete it.  To work around this
 ** problem, we delay 100 milliseconds and try to delete again.  Up
 ** to MX_DELETION_ATTEMPTs deletion attempts are run before giving
 ** up and returning an error.
 */
-#define MX_DELETION_ATTEMPTS 3
+#define MX_DELETION_ATTEMPTS 5
 static int winDelete(
   sqlite3_vfs *pVfs,          /* Not used on win32 */
   const char *zFilename,      /* Name of file to delete */
@@ -1209,22 +1209,22 @@ static int winDelete(
   SimulateIOError(return SQLITE_IOERR_DELETE);
   if( isNT() ){
     do{
-      rc = DeleteFileW(zConverted);
-    }while( rc==0 && GetFileAttributesW(zConverted)!=0xffffffff 
+      DeleteFileW(zConverted);
+    }while( (rc = GetFileAttributesW(zConverted))!=0xffffffff 
             && cnt++ < MX_DELETION_ATTEMPTS && (Sleep(100), 1) );
   }else{
 #if OS_WINCE
     return SQLITE_NOMEM;
 #else
     do{
-      rc = DeleteFileA(zConverted);
-    }while( rc==0 && GetFileAttributesA(zConverted)!=0xffffffff
+      DeleteFileA(zConverted);
+    }while( (rc = GetFileAttributesA(zConverted))!=0xffffffff
             && cnt++ < MX_DELETION_ATTEMPTS && (Sleep(100), 1) );
 #endif
   }
   free(zConverted);
   OSTRACE2("DELETE \"%s\"\n", zFilename);
-  return rc!=0 ? SQLITE_OK : SQLITE_IOERR;
+  return rc==0xffffffff ? SQLITE_OK : SQLITE_IOERR_DELETE;
 }
 
 /*