diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/os_unix.c | 9 | ||||
-rw-r--r-- | src/pager.c | 1 | ||||
-rw-r--r-- | src/sqlite.h.in | 1 |
3 files changed, 9 insertions, 2 deletions
diff --git a/src/os_unix.c b/src/os_unix.c index 9b6c9401a..1de88f942 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -5374,8 +5374,13 @@ static int unixDelete( int rc = SQLITE_OK; UNUSED_PARAMETER(NotUsed); SimulateIOError(return SQLITE_IOERR_DELETE); - if( osUnlink(zPath)==(-1) && errno!=ENOENT ){ - return unixLogError(SQLITE_IOERR_DELETE, "unlink", zPath); + if( osUnlink(zPath)==(-1) ){ + if( errno==ENOENT ){ + rc = SQLITE_IOERR_DELETE_NOENT; + }else{ + rc = SQLITE_IOERR_DELETE; + } + return unixLogError(rc, "unlink", zPath); } #ifndef SQLITE_DISABLE_DIRSYNC if( (dirSync & 1)!=0 ){ diff --git a/src/pager.c b/src/pager.c index a96dc45b8..7c039e7a7 100644 --- a/src/pager.c +++ b/src/pager.c @@ -3159,6 +3159,7 @@ static int pagerOpenWalIfPresent(Pager *pPager){ if( rc ) return rc; if( nPage==0 ){ rc = sqlite3OsDelete(pPager->pVfs, pPager->zWal, 0); + if( rc==SQLITE_IOERR_DELETE_NOENT ) rc = SQLITE_OK; isWal = 0; }else{ rc = sqlite3OsAccess( diff --git a/src/sqlite.h.in b/src/sqlite.h.in index 0d619e96c..520cccd04 100644 --- a/src/sqlite.h.in +++ b/src/sqlite.h.in @@ -469,6 +469,7 @@ int sqlite3_exec( #define SQLITE_IOERR_SHMLOCK (SQLITE_IOERR | (20<<8)) #define SQLITE_IOERR_SHMMAP (SQLITE_IOERR | (21<<8)) #define SQLITE_IOERR_SEEK (SQLITE_IOERR | (22<<8)) +#define SQLITE_IOERR_DELETE_NOENT (SQLITE_IOERR | (23<<8)) #define SQLITE_LOCKED_SHAREDCACHE (SQLITE_LOCKED | (1<<8)) #define SQLITE_BUSY_RECOVERY (SQLITE_BUSY | (1<<8)) #define SQLITE_CANTOPEN_NOTEMPDIR (SQLITE_CANTOPEN | (1<<8)) |