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:
@@ -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 ){
|
||||
|
||||
Reference in New Issue
Block a user