/ Check-in [f64ea8a0]
Login

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

Overview
Comment:Change the SQLITE_NO_SYNC compile-time option to call fstat() in place of fsync() rather than being a total no-op.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: f64ea8a052af9790d5e6987cbd5e81d77da6f172
User & Date: drh 2015-12-02 02:33:36
Context
2015-12-02
13:11
Minor simplifications to the unix VFS. check-in: 2f13c16b user: drh tags: trunk
02:33
Change the SQLITE_NO_SYNC compile-time option to call fstat() in place of fsync() rather than being a total no-op. check-in: f64ea8a0 user: drh tags: trunk
02:08
Fix a (harmless) off-by-one error in the unix VFS logic that fsync()s a directory after deleting a file. check-in: 3d02711a user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/os_unix.c.

  3387   3387     */
  3388   3388   #ifdef SQLITE_TEST
  3389   3389     if( fullSync ) sqlite3_fullsync_count++;
  3390   3390     sqlite3_sync_count++;
  3391   3391   #endif
  3392   3392   
  3393   3393     /* If we compiled with the SQLITE_NO_SYNC flag, then syncing is a
  3394         -  ** no-op
         3394  +  ** no-op.  But go ahead and call fstat() to validate the file
         3395  +  ** descriptor as we need a method to provoke a failure during
         3396  +  ** coverate testing.
  3395   3397     */
  3396   3398   #ifdef SQLITE_NO_SYNC
  3397         -  rc = SQLITE_OK;
         3399  +  {
         3400  +    struct stat buf;
         3401  +    rc = osFstat(fd, &buf);
         3402  +  }
  3398   3403   #elif HAVE_FULLFSYNC
  3399   3404     if( fullSync ){
  3400   3405       rc = osFcntl(fd, F_FULLFSYNC, 0);
  3401   3406     }else{
  3402   3407       rc = 1;
  3403   3408     }
  3404   3409     /* If the FULLFSYNC failed, fall back to attempting an fsync().