aboutsummaryrefslogtreecommitdiff
path: root/src/os_unix.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/os_unix.c')
-rw-r--r--src/os_unix.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/os_unix.c b/src/os_unix.c
index 483075c83..2d6f40413 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -872,9 +872,11 @@ int sqlite3OsSync(OsFile *id, int dataOnly){
}
if( id->dirfd>=0 ){
TRACE2("DIRSYNC %-3d\n", id->dirfd);
+#ifndef SQLITE_DISABLE_DIRSYNC
if( full_fsync(id->dirfd, id->fullSync, 0) ){
return SQLITE_IOERR;
}
+#endif
close(id->dirfd); /* Only need to sync once, so close the directory */
id->dirfd = -1; /* when we are done. */
}
@@ -890,6 +892,9 @@ int sqlite3OsSync(OsFile *id, int dataOnly){
** The F_FULLFSYNC option is not needed here.
*/
int sqlite3OsSyncDirectory(const char *zDirname){
+#ifdef SQLITE_DISABLE_DIRSYNC
+ return SQLITE_OK;
+#else
int fd;
int r;
SimulateIOError(SQLITE_IOERR);
@@ -901,6 +906,7 @@ int sqlite3OsSyncDirectory(const char *zDirname){
r = fsync(fd);
close(fd);
return ((r==0)?SQLITE_OK:SQLITE_IOERR);
+#endif
}
/*