aboutsummaryrefslogtreecommitdiff
path: root/src/os_unix.c
diff options
context:
space:
mode:
authordan <dan@noemail.net>2012-11-09 20:17:26 +0000
committerdan <dan@noemail.net>2012-11-09 20:17:26 +0000
commit9fc5b4a5399144db31b1bf88632ea615dcd5fb2f (patch)
treed1182f52492414c555c4b381b628fe2286518eae /src/os_unix.c
parent9c0a8ee57c5ab9cd2c4547a669ad7f7b84791e20 (diff)
downloadsqlite-9fc5b4a5399144db31b1bf88632ea615dcd5fb2f.tar.gz
sqlite-9fc5b4a5399144db31b1bf88632ea615dcd5fb2f.zip
Change os_unix.c to propagate ENOENT errors back to sqlite as SQLITE_IOERR_DELETE_NOENT. Have SQLite ignore these where they are benign and propagate them back to the caller where they may indicate a file-system malfunction of some description.
FossilOrigin-Name: bed9c172ce624ab7b5b9de9ad42444891717ad9a
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 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 ){