diff options
author | drh <drh@noemail.net> | 2015-12-02 02:33:36 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2015-12-02 02:33:36 +0000 |
commit | 2c8fd12f42e9f093b935e5225d9e6978825f77b6 (patch) | |
tree | 29ef8cbd5fdb06f74458b965729cff20dde30e8e /src | |
parent | adfa22e118e7a0db0a89ff899ddcd48d517e9c31 (diff) | |
download | sqlite-2c8fd12f42e9f093b935e5225d9e6978825f77b6.tar.gz sqlite-2c8fd12f42e9f093b935e5225d9e6978825f77b6.zip |
Change the SQLITE_NO_SYNC compile-time option to call fstat() in place of
fsync() rather than being a total no-op.
FossilOrigin-Name: f64ea8a052af9790d5e6987cbd5e81d77da6f172
Diffstat (limited to 'src')
-rw-r--r-- | src/os_unix.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/os_unix.c b/src/os_unix.c index 8eff392a6..7038bf12d 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -3391,10 +3391,15 @@ static int full_fsync(int fd, int fullSync, int dataOnly){ #endif /* If we compiled with the SQLITE_NO_SYNC flag, then syncing is a - ** no-op + ** no-op. But go ahead and call fstat() to validate the file + ** descriptor as we need a method to provoke a failure during + ** coverate testing. */ #ifdef SQLITE_NO_SYNC - rc = SQLITE_OK; + { + struct stat buf; + rc = osFstat(fd, &buf); + } #elif HAVE_FULLFSYNC if( fullSync ){ rc = osFcntl(fd, F_FULLFSYNC, 0); |