diff options
author | drh <drh@noemail.net> | 2009-02-03 15:27:02 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2009-02-03 15:27:02 +0000 |
commit | eb0d74ff396cdb1ffcf2cb2133c7b3b7c607b663 (patch) | |
tree | 4000209d21bdc5350e220a03fe4e0f7f35b704c9 /src/os_unix.c | |
parent | f158162191c4749a6bd912fff8f32771478ce150 (diff) | |
download | sqlite-eb0d74ff396cdb1ffcf2cb2133c7b3b7c607b663.tar.gz sqlite-eb0d74ff396cdb1ffcf2cb2133c7b3b7c607b663.zip |
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
Diffstat (limited to 'src/os_unix.c')
-rw-r--r-- | src/os_unix.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/os_unix.c b/src/os_unix.c index 918a1edf6..9ac7f7b2b 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; |