From: drh Date: Wed, 14 Jul 2010 01:45:22 +0000 (+0000) Subject: Fix the unix driver to return an I/O error if unlink fails for any reason X-Git-Tag: version-3.7.2~137 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5d4feffe7d96893d6eb339818101615748618673;p=thirdparty%2Fsqlite.git Fix the unix driver to return an I/O error if unlink fails for any reason other than the file not existing in the first place. FossilOrigin-Name: 90d73c66bfa880cdeb688b3016c8b1c58bfcf35f --- diff --git a/manifest b/manifest index 754d225879..44e2aa1aca 100644 --- 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----- diff --git a/manifest.uuid b/manifest.uuid index e2dfbeba0c..24daec48b8 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -2b68e50268412599576c86ae70b830d0388cb35c \ No newline at end of file +90d73c66bfa880cdeb688b3016c8b1c58bfcf35f \ No newline at end of file diff --git a/src/os_unix.c b/src/os_unix.c index ba614c5632..0c6519ac37 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -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;