/ Check-in [90d73c66]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment: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.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 90d73c66bfa880cdeb688b3016c8b1c58bfcf35f
User & Date: drh 2010-07-14 01:45:23
Context
2010-07-14
06:20
Fix a typo in the IS_BIG_INT macro used by coverage test instrumentation. check-in: 5314ca39 user: dan tags: trunk
01:45
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. check-in: 90d73c66 user: drh tags: trunk
00:22
Remove the xShmOpen method from the VFS. Shared-memory is opened automatically by a call to xShmMap. Rename the xShmClose method to xShmUnmap. check-in: 2b68e502 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/os_unix.c.

  4549   4549     sqlite3_vfs *NotUsed,     /* VFS containing this as the xDelete method */
  4550   4550     const char *zPath,        /* Name of file to be deleted */
  4551   4551     int dirSync               /* If true, fsync() directory after deleting file */
  4552   4552   ){
  4553   4553     int rc = SQLITE_OK;
  4554   4554     UNUSED_PARAMETER(NotUsed);
  4555   4555     SimulateIOError(return SQLITE_IOERR_DELETE);
  4556         -  unlink(zPath);
         4556  +  if( unlink(zPath)==(-1) && errno!=ENOENT ){
         4557  +    return SQLITE_IOERR_DELETE;
         4558  +  }
  4557   4559   #ifndef SQLITE_DISABLE_DIRSYNC
  4558   4560     if( dirSync ){
  4559   4561       int fd;
  4560   4562       rc = openDirectory(zPath, &fd);
  4561   4563       if( rc==SQLITE_OK ){
  4562   4564   #if OS_VXWORKS
  4563   4565         if( fsync(fd)==-1 )