aboutsummaryrefslogtreecommitdiff
path: root/src/os_unix.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/os_unix.c')
-rw-r--r--src/os_unix.c9
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;