diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 4 | ||||
-rw-r--r-- | src/os_unix.c | 21 |
2 files changed, 15 insertions, 10 deletions
diff --git a/src/main.c b/src/main.c index 2ed200b06..668db1255 100644 --- a/src/main.c +++ b/src/main.c @@ -14,7 +14,7 @@ ** other files are for internal use by SQLite and should not be ** accessed by users of the library. ** -** $Id: main.c,v 1.437 2008/05/01 17:03:49 drh Exp $ +** $Id: main.c,v 1.438 2008/05/05 16:56:35 drh Exp $ */ #include "sqliteInt.h" #include <ctype.h> @@ -306,7 +306,7 @@ const char *sqlite3ErrStr(int rc){ case SQLITE_CONSTRAINT: z = "constraint failed"; break; case SQLITE_MISMATCH: z = "datatype mismatch"; break; case SQLITE_MISUSE: z = "library routine called out of sequence";break; - case SQLITE_NOLFS: z = "kernel lacks large file support"; break; + case SQLITE_NOLFS: z = "large file support is disabled"; break; case SQLITE_AUTH: z = "authorization denied"; break; case SQLITE_FORMAT: z = "auxiliary database format error"; break; case SQLITE_RANGE: z = "bind or column index out of range"; break; diff --git a/src/os_unix.c b/src/os_unix.c index ca1f20b99..f5bc49077 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -617,7 +617,7 @@ static sqlite3LockingStyle sqlite3DetectLockingStyle( ** describes that file descriptor. Create new ones if necessary. The ** return values might be uninitialized if an error occurs. ** -** Return the number of errors. +** Return an appropriate error code. */ static int findLockInfo( int fd, /* The file descriptor used in the key */ @@ -631,7 +631,12 @@ static int findLockInfo( struct lockInfo *pLock; struct openCnt *pOpen; rc = fstat(fd, &statbuf); - if( rc!=0 ) return 1; + if( rc!=0 ){ +#ifdef EOVERFLOW + if( errno==EOVERFLOW ) return SQLITE_NOLFS; +#endif + return SQLITE_IOERR; + } memset(&key1, 0, sizeof(key1)); key1.dev = statbuf.st_dev; @@ -650,7 +655,7 @@ static int findLockInfo( struct lockInfo *pOld; pLock = sqlite3_malloc( sizeof(*pLock) ); if( pLock==0 ){ - rc = 1; + rc = SQLITE_NOMEM; goto exit_findlockinfo; } pLock->key = key1; @@ -661,7 +666,7 @@ static int findLockInfo( if( pOld!=0 ){ assert( pOld==pLock ); sqlite3_free(pLock); - rc = 1; + rc = SQLITE_NOMEM; goto exit_findlockinfo; } }else{ @@ -675,7 +680,7 @@ static int findLockInfo( pOpen = sqlite3_malloc( sizeof(*pOpen) ); if( pOpen==0 ){ releaseLockInfo(pLock); - rc = 1; + rc = SQLITE_NOMEM; goto exit_findlockinfo; } pOpen->key = key2; @@ -688,7 +693,7 @@ static int findLockInfo( assert( pOld==pOpen ); sqlite3_free(pOpen); releaseLockInfo(pLock); - rc = 1; + rc = SQLITE_NOMEM; goto exit_findlockinfo; } }else{ @@ -2189,7 +2194,7 @@ static int fillInUnixFile( if( rc ){ if( dirfd>=0 ) close(dirfd); close(h); - return SQLITE_NOMEM; + return rc; } } else { /* pLock and pOpen are only used for posix advisory locking */ @@ -2278,7 +2283,7 @@ static int fillInUnixFile( if( rc ){ if( dirfd>=0 ) close(dirfd); close(h); - return SQLITE_NOMEM; + return rc; } OSTRACE3("OPEN %-3d %s\n", h, zFilename); |