diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/os_unix.c | 6 | ||||
-rw-r--r-- | src/test1.c | 8 |
2 files changed, 13 insertions, 1 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 } /* diff --git a/src/test1.c b/src/test1.c index 370e3745b..0c0d4a4c9 100644 --- a/src/test1.c +++ b/src/test1.c @@ -13,7 +13,7 @@ ** is not included in the SQLite library. It is used for automated ** testing of the SQLite library. ** -** $Id: test1.c,v 1.164 2005/11/25 09:01:24 danielk1977 Exp $ +** $Id: test1.c,v 1.165 2005/11/25 10:38:22 danielk1977 Exp $ */ #include "sqliteInt.h" #include "tcl.h" @@ -2823,6 +2823,12 @@ static void set_options(Tcl_Interp *interp){ Tcl_SetVar2(interp, "sqlite_options","casesensitivelike","0",TCL_GLOBAL_ONLY); #endif +#ifdef SQLITE_DISABLE_DIRSYNC + Tcl_SetVar2(interp, "sqlite_options", "dirsync", "0", TCL_GLOBAL_ONLY); +#else + Tcl_SetVar2(interp, "sqlite_options", "dirsync", "1", TCL_GLOBAL_ONLY); +#endif + #ifdef SQLITE_DISABLE_LFS Tcl_SetVar2(interp, "sqlite_options", "lfs", "0", TCL_GLOBAL_ONLY); #else |