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

Fix the unix driver to return an I/O error if unlink fails for any reason

other than the file not existing in the first place.

FossilOrigin-Name: 90d73c66bfa880cdeb688b3016c8b1c58bfcf35f
This commit is contained in:
drh
2010-07-14 01:45:22 +00:00
parent 54e0536275
commit 5d4feffe7d
3 changed files with 13 additions and 11 deletions

View File

@@ -4553,7 +4553,9 @@ static int unixDelete(
int rc = SQLITE_OK;
UNUSED_PARAMETER(NotUsed);
SimulateIOError(return SQLITE_IOERR_DELETE);
unlink(zPath);
if( unlink(zPath)==(-1) && errno!=ENOENT ){
return SQLITE_IOERR_DELETE;
}
#ifndef SQLITE_DISABLE_DIRSYNC
if( dirSync ){
int fd;