From eb0d74ff396cdb1ffcf2cb2133c7b3b7c607b663 Mon Sep 17 00:00:00 2001 From: drh Date: Tue, 3 Feb 2009 15:27:02 +0000 Subject: [PATCH] Check at the write() call to work around the msdos bug in OSX actually succeeds and throw an error if it does not. #ifdef out the work-around for all platforms other than OSX. Ticket #3633. (CVS 6237) FossilOrigin-Name: b054b569172c53f4e185e4a64f41d08784aa0f8b --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/os_unix.c | 9 +++++++-- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/manifest b/manifest index 3c05708a76..0438dfabb7 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\sa\sspecial\srule\sto\sthe\samalgamation\sgenerator\sto\sdeal\swith\nthe\ssqlite3OsDlSym\sfunction.\s\sTicket\s#3631.\s(CVS\s6236) -D 2009-02-03T13:51:18 +C Check\sat\sthe\swrite()\scall\sto\swork\saround\sthe\smsdos\sbug\sin\sOSX\sactually\nsucceeds\sand\sthrow\san\serror\sif\sit\sdoes\snot.\s\s#ifdef\sout\sthe\swork-around\nfor\sall\splatforms\sother\sthan\sOSX.\s\sTicket\s#3633.\s(CVS\s6237) +D 2009-02-03T15:27:02 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.in 3871d308188cefcb7c5ab20da4c7b6aad023bc52 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -140,7 +140,7 @@ F src/os.c ed93a6b46132a602c4fd7a58142e2981c829c79d F src/os.h f996ab57d2035a20e63173419055608548a834c6 F src/os_common.h 24525d8b7bce66c374dfc1810a6c9043f3359b60 F src/os_os2.c bed77dc26e3a95ce4a204936b9a1ca6fe612fcc5 -F src/os_unix.c c74255cc1fcddc38fc3cc1dcf70c2325d3c2948e +F src/os_unix.c f0fce3042011d462b8ae633564a5668260bd3636 F src/os_win.c ec133f2a3c0da786995ea09ba67056af8f18cc2e F src/pager.c 72f4e7b3076584889ce6286cd15ff2d985325026 F src/pager.h eccf5cdeebd79006ba7f9577dd30d8179b1430da @@ -695,7 +695,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81 F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e -P 1ffe44e9d6b49346a75850a977953de12c127069 -R 35f24f396c22640dc5d33d1ae8df531a +P 876f874c6e2e6e7763083e6761eedc10a4522ec9 +R 03f24e95410db9478f89a6a5008336d8 U drh -Z a395923455cb532eb6d33af3163637d2 +Z b153f89d67dc071f437e82912b395cd3 diff --git a/manifest.uuid b/manifest.uuid index aaa5b7a5f7..7e5c46d304 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -876f874c6e2e6e7763083e6761eedc10a4522ec9 \ No newline at end of file +b054b569172c53f4e185e4a64f41d08784aa0f8b \ No newline at end of file diff --git a/src/os_unix.c b/src/os_unix.c index 918a1edf69..9ac7f7b2bf 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -43,7 +43,7 @@ ** * Definitions of sqlite3_vfs objects for all locking methods ** plus implementations of sqlite3_os_init() and sqlite3_os_end(). ** -** $Id: os_unix.c,v 1.238 2009/01/16 23:47:42 drh Exp $ +** $Id: os_unix.c,v 1.239 2009/02/03 15:27:02 drh Exp $ */ #include "sqliteInt.h" #if SQLITE_OS_UNIX /* This file is used on unix only */ @@ -920,6 +920,7 @@ static int findLockInfo( return SQLITE_IOERR; } +#ifdef __APPLE__ /* On OS X on an msdos filesystem, the inode number is reported ** incorrectly for zero-size files. See ticket #3260. To work ** around this problem (we consider it a bug in OS X, not SQLite) @@ -931,13 +932,17 @@ static int findLockInfo( ** the first page of the database, no damage is done. */ if( statbuf.st_size==0 ){ - write(fd, "S", 1); + rc = write(fd, "S", 1); + if( rc!=1 ){ + return SQLITE_IOERR; + } rc = fstat(fd, &statbuf); if( rc!=0 ){ pFile->lastErrno = errno; return SQLITE_IOERR; } } +#endif memset(&lockKey, 0, sizeof(lockKey)); lockKey.fid.dev = statbuf.st_dev; -- 2.47.2