aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2009-03-25 01:06:01 +0000
committerdrh <drh@noemail.net>2009-03-25 01:06:01 +0000
commit892404323f0ca6ae3fb8d8b5ba01cb2429069f1c (patch)
tree4429299d3d0d138926376261ab1aa860663cffb1 /src
parent72bcfa6eeb244be56ccb8e2cec3ce6ddb5877793 (diff)
downloadsqlite-892404323f0ca6ae3fb8d8b5ba01cb2429069f1c.tar.gz
sqlite-892404323f0ca6ae3fb8d8b5ba01cb2429069f1c.zip
Use fdatasync() only on linux, unless -Dfdatasync=fdatasync is set at
compilation time. (CVS 6383) FossilOrigin-Name: cbf2ca4cc41f1f710635b863db6e98074bd5e8bc
Diffstat (limited to 'src')
-rw-r--r--src/os_unix.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/os_unix.c b/src/os_unix.c
index 01ca657b7..4909baaa3 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -43,7 +43,7 @@
** * Definitions of sqlite3_vfs objects for all locking methods
** plus implementations of sqlite3_os_init() and sqlite3_os_end().
**
-** $Id: os_unix.c,v 1.244 2009/03/21 14:56:52 drh Exp $
+** $Id: os_unix.c,v 1.245 2009/03/25 01:06:02 drh Exp $
*/
#include "sqliteInt.h"
#if SQLITE_OS_UNIX /* This file is used on unix only */
@@ -2824,10 +2824,12 @@ int sqlite3_fullsync_count = 0;
#endif
/*
-** We assume that most systems these days support fdatasync(). Those
-** machines that do not can define -Dfdatasync=fsync.
+** We do not trust systems to provide a working fdatasync(). Some do.
+** Others do no. To be safe, we will stick with the (slower) fsync().
+** If you know that your system does support fdatasync() correctly,
+** then simply compile with -Dfdatasync=fdatasync
*/
-#if 0
+#if !defined(fdatasync) && !defined(__linux__)
# define fdatasync fsync
#endif