]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Fix the unix driver to return an I/O error if unlink fails for any reason
authordrh <drh@noemail.net>
Wed, 14 Jul 2010 01:45:22 +0000 (01:45 +0000)
committerdrh <drh@noemail.net>
Wed, 14 Jul 2010 01:45:22 +0000 (01:45 +0000)
other than the file not existing in the first place.

FossilOrigin-Name: 90d73c66bfa880cdeb688b3016c8b1c58bfcf35f

manifest
manifest.uuid
src/os_unix.c

index 754d225879bbdd7c65e7d06a37fe73d64180dcd2..44e2aa1aca1e99c8d354c8a99d7e752eb0989929 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,8 +1,8 @@
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 
-C Remove\sthe\sxShmOpen\smethod\sfrom\sthe\sVFS.\s\sShared-memory\sis\sopened\sautomatically\nby\sa\scall\sto\sxShmMap.\s\sRename\sthe\sxShmClose\smethod\sto\sxShmUnmap.
-D 2010-07-14T00:22:36
+C Fix\sthe\sunix\sdriver\sto\sreturn\san\sI/O\serror\sif\sunlink\sfails\sfor\sany\sreason\nother\sthan\sthe\sfile\snot\sexisting\sin\sthe\sfirst\splace.
+D 2010-07-14T01:45:23
 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
 F Makefile.in ec08dc838fd8110fe24c92e5130bcd91cbb1ff2e
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -157,7 +157,7 @@ F src/os.c a0ecbd198b92e60a3e3b8887a668df3f80b4f62f
 F src/os.h 9dbed8c2b9c1f2f2ebabc09e49829d4777c26bf9
 F src/os_common.h a8f95b81eca8a1ab8593d23e94f8a35f35d4078f
 F src/os_os2.c 665876d5eec7585226b0a1cf5e18098de2b2da19
-F src/os_unix.c 7845a3c91b5e5e1ed3c5e7f5430ff8af7e9d6c02
+F src/os_unix.c cfcb63d4aadadd75ef89c41563bf15332eef4e4e
 F src/os_win.c 61734aad7f50b28f3c76eb4b19b63472f6d825d9
 F src/pager.c 78ca1e1f3315c8227431c403c04d791dccf242fb
 F src/pager.h 879fdde5a102d2f21a3135d6f647530b21c2796c
@@ -837,14 +837,14 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
 F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
-P 597d40fa529073123a50ae6afc762c59404f8f5f c2d27cf51d33e6f38bab37008d39074051f75274
-R ed9e8ba444308d86203809c921582295
+P 2b68e50268412599576c86ae70b830d0388cb35c
+R dad5407613534d18615d6ce46938d2e2
 U drh
-Z 76541e7ad3808e0604906bf1fc532690
+Z d36b8c2e8666bd5e4a1f76283f4d1dc0
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.6 (GNU/Linux)
 
-iD8DBQFMPQNPoxKgR168RlERAioBAJ9xlZcJfJlK34lIspobQYDe842CLQCdFqz0
-PexiupCstye/oPNnjaqjdbY=
-=AS0q
+iD8DBQFMPRa1oxKgR168RlERArO5AJ9u9t4Gp9UxPBxDzic5qy4T060D+QCdE121
+Hm2QlfmIbUB3Sl1pvqw+w74=
+=nKd9
 -----END PGP SIGNATURE-----
index e2dfbeba0cb2aa58620f1a38d9b5c886985252d4..24daec48b82dd444b4d40708367937681166d4af 100644 (file)
@@ -1 +1 @@
-2b68e50268412599576c86ae70b830d0388cb35c
\ No newline at end of file
+90d73c66bfa880cdeb688b3016c8b1c58bfcf35f
\ No newline at end of file
index ba614c5632a6e9850ae6439833822f139a18237a..0c6519ac37bbc02ca802ee1f2f46274938003989 100644 (file)
@@ -4553,7 +4553,9 @@ static int unixDelete(
   int rc = SQLITE_OK;
   UNUSED_PARAMETER(NotUsed);
   SimulateIOError(return SQLITE_IOERR_DELETE);
-  unlink(zPath);
+  if( unlink(zPath)==(-1) && errno!=ENOENT ){
+    return SQLITE_IOERR_DELETE;
+  }
 #ifndef SQLITE_DISABLE_DIRSYNC
   if( dirSync ){
     int fd;