]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
On WinCE, fill in the winFile structure after winceCreateLock has succeeded.
authormistachkin <mistachkin@noemail.net>
Wed, 13 Feb 2013 22:54:03 +0000 (22:54 +0000)
committermistachkin <mistachkin@noemail.net>
Wed, 13 Feb 2013 22:54:03 +0000 (22:54 +0000)
FossilOrigin-Name: ec13544ce336e8a02b34d574ced5912b06c82c0e

manifest
manifest.uuid
src/os_win.c

index 2555acf5c8faf868c7df377abaa61e43ac1ac693..682d1cdfa502f19cf59e45eab6f0af1ab150f373 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Add\srecent\sAPI\sadditions\sto\sthe\sextension\smechanism.
-D 2013-02-13T14:04:28.390
+C On\sWinCE,\sfill\sin\sthe\swinFile\sstructure\safter\swinceCreateLock\shas\ssucceeded.
+D 2013-02-13T22:54:03.955
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in a48faa9e7dd7d556d84f5456eabe5825dd8a6282
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -161,7 +161,7 @@ F src/os.c e1acdc09ff3ac2412945cca9766e2dcf4675f31c
 F src/os.h 027491c77d2404c0a678bb3fb06286f331eb9b57
 F src/os_common.h 92815ed65f805560b66166e3583470ff94478f04
 F src/os_unix.c dfdc04b126f7b05dcb2e2cc5c1262f98acbb49d9
-F src/os_win.c e988c2de4266fbb3b8c58e4b5550a2e17f541327
+F src/os_win.c e27fafe8d04841bbe8d925003a4276b80fb59e73
 F src/pager.c 4092c907222cfd451c74fe6bd2fd64b342f7190f
 F src/pager.h 1109a06578ec5574dc2c74cf8d9f69daf36fe3e0
 F src/parse.y 5d5e12772845805fdfeb889163516b84fbb9ae95
@@ -1034,7 +1034,7 @@ F tool/vdbe-compress.tcl f12c884766bd14277f4fcedcae07078011717381
 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
 F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
 F tool/win/sqlite.vsix 97894c2790eda7b5bce3cc79cb2a8ec2fde9b3ac
-P 2cef8b68f0e1216cf68bb7dd45a5a9a330748070
-R cabc7a2fdbd232266103a87943ce9702
-U drh
-Z afea31491ba485b5cd581a2534ab702a
+P 7e10a62d0eb1cb2bdafb6752b78a9d368e9f21f5
+R 6de95ef06bdbb69d4dc56118d603276a
+U mistachkin
+Z cedfeda70156e3f731cd5d4242d033d6
index 6561e3243806b8e8d01eabd38ed54d0a323b1e87..5da994060e0c6ed5a77064cb9eb5de268ace370d 100644 (file)
@@ -1 +1 @@
-7e10a62d0eb1cb2bdafb6752b78a9d368e9f21f5
\ No newline at end of file
+ec13544ce336e8a02b34d574ced5912b06c82c0e
\ No newline at end of file
index bbc9c27b7a6e72171c36a0cdf4e7436aa66852b9..59ff6833fa7b962004beeb2dea71b40f0c074b9b 100644 (file)
@@ -2076,6 +2076,7 @@ static int winClose(sqlite3_file *id){
   assert( pFile->pShm==0 );
 #endif
   OSTRACE(("CLOSE %d\n", pFile->h));
+  assert( pFile->h!=NULL && pFile->h!=INVALID_HANDLE_VALUE );
   do{
     rc = osCloseHandle(pFile->h);
     /* SimulateIOError( rc=0; cnt=MX_CLOSE_ATTEMPT; ); */
@@ -3687,8 +3688,9 @@ static int winOpen(
        || eType==SQLITE_OPEN_TRANSIENT_DB || eType==SQLITE_OPEN_WAL
   );
 
-  assert( id!=0 );
-  UNUSED_PARAMETER(pVfs);
+  assert( pFile!=0 );
+  memset(pFile, 0, sizeof(winFile));
+  pFile->h = INVALID_HANDLE_VALUE;
 
 #if SQLITE_OS_WINRT
   if( !sqlite3_temp_directory ){
@@ -3697,8 +3699,6 @@ static int winOpen(
   }
 #endif
 
-  pFile->h = INVALID_HANDLE_VALUE;
-
   /* If the second argument to this function is NULL, generate a 
   ** temporary file name to use 
   */
@@ -3841,19 +3841,6 @@ static int winOpen(
     }
   }
 
-  memset(pFile, 0, sizeof(*pFile));
-  pFile->pMethod = &winIoMethod;
-  pFile->h = h;
-  pFile->lastErrno = NO_ERROR;
-  pFile->pVfs = pVfs;
-#ifndef SQLITE_OMIT_WAL
-  pFile->pShm = 0;
-#endif
-  pFile->zPath = zName;
-  if( sqlite3_uri_boolean(zName, "psow", SQLITE_POWERSAFE_OVERWRITE) ){
-    pFile->ctrlFlags |= WINFILE_PSOW;
-  }
-
 #if SQLITE_OS_WINCE
   if( isReadWrite && eType==SQLITE_OPEN_MAIN_DB
        && (rc = winceCreateLock(zName, pFile))!=SQLITE_OK
@@ -3870,6 +3857,15 @@ static int winOpen(
     sqlite3_free(zConverted);
   }
 
+  pFile->pMethod = &winIoMethod;
+  pFile->pVfs = pVfs;
+  pFile->h = h;
+  if( sqlite3_uri_boolean(zName, "psow", SQLITE_POWERSAFE_OVERWRITE) ){
+    pFile->ctrlFlags |= WINFILE_PSOW;
+  }
+  pFile->lastErrno = NO_ERROR;
+  pFile->zPath = zName;
+
   OpenCounter(+1);
   return rc;
 }