1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

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
This commit is contained in:
dan
2012-11-09 20:17:26 +00:00
parent 9c0a8ee57c
commit 9fc5b4a539
6 changed files with 48 additions and 13 deletions

View File

@@ -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 ){