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

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
This commit is contained in:
drh
2015-12-02 02:33:36 +00:00
parent adfa22e118
commit 2c8fd12f42
3 changed files with 14 additions and 9 deletions

View File

@@ -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);