]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Another attempt to get fdatasync to be ignored on non-conforming posix systems.
authordrh <drh@noemail.net>
Wed, 5 Oct 2005 10:29:36 +0000 (10:29 +0000)
committerdrh <drh@noemail.net>
Wed, 5 Oct 2005 10:29:36 +0000 (10:29 +0000)
Now a system has to opt-in for fdatasync instead of opt-out.
Ticket #1467. (CVS 2741)

FossilOrigin-Name: 115340d4e85f1bbbab657edbb504284343d86e2c

Makefile.linux-gcc
configure
configure.ac
manifest
manifest.uuid
src/os_unix.c

index 202f4a1ee2523f11464ae615754744aab87a271d..c021a8f83000708888830a30f5699fa1c53f84f6 100644 (file)
@@ -53,6 +53,7 @@ THREADLIB =
 #OPTS = -DSQLITE_DEBUG=1
 #OPTS = 
 OPTS = -DNDEBUG=1
+OPTS += -DHAVE_FDATASYNC=1
 
 #### The suffix to add to executable files.  ".exe" for windows.
 #    Nothing for unix.
index fb63100d70e0f766d5fb4eeec2e9b20dd0e63d09..e90a4e25816ce66db5c73aeb49debfc8e218d224 100755 (executable)
--- a/configure
+++ b/configure
@@ -1496,7 +1496,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 # The following RCS revision string applies to configure.in
-# $Revision: 1.32 $
+# $Revision: 1.33 $
 
 #########
 # Programs needed
 echo "$as_me:$LINENO: result: $ac_cv_func_fdatasync" >&5
 echo "${ECHO_T}$ac_cv_func_fdatasync" >&6
 if test $ac_cv_func_fdatasync = yes; then
-  :
-else
-  cat >>confdefs.h <<\_ACEOF
-#define fdatasync fsync
-_ACEOF
-
+  TARGET_CFLAGS="$TARGET_CFLAGS -DHAVE_FDATASYNC=1"
 fi
 
 
-
 #########
 # Generate the output files.
 #
index 54bb72695a50952341ad569c236a63945c1cf1ea..e230288bae02fd9fdbc31dfbe479c97891321b3e 100644 (file)
@@ -116,7 +116,7 @@ AC_INIT(src/sqlite.h.in)
 dnl Put the RCS revision string after AC_INIT so that it will also
 dnl show in in configure.
 # The following RCS revision string applies to configure.in
-# $Revision: 1.18 $
+# $Revision: 1.19 $
 
 #########
 # Programs needed
@@ -611,8 +611,7 @@ AC_CHECK_FUNC(usleep, [TARGET_CFLAGS="$TARGET_CFLAGS -DHAVE_USLEEP=1"])
 # Redefine fdatasync as fsync on systems that lack fdatasync
 #--------------------------------------------------------------------
 
-AC_CHECK_FUNC(fdatasync, , AC_DEFINE(fdatasync, fsync))
-
+AC_CHECK_FUNC(fdatasync, [TARGET_CFLAGS="$TARGET_CFLAGS -DHAVE_FDATASYNC=1"])
 
 #########
 # Generate the output files.
index 14495ca57860d33601b3ef85a9aa7f982e501c77..6f969abe02717628920febbeb2f21542f95bc9d3 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,7 +1,7 @@
-C Add\sthe\sSQLITE_OMIT_GET_TABLE\scompile-time\sflag.\s(CVS\s2740)
-D 2005-10-05T02:13:41
+C Another\sattempt\sto\sget\sfdatasync\sto\sbe\signored\son\snon-conforming\sposix\ssystems.\nNow\sa\ssystem\shas\sto\sopt-in\sfor\sfdatasync\sinstead\sof\sopt-out.\nTicket\s#1467.\s(CVS\s2741)
+D 2005-10-05T10:29:36
 F Makefile.in 12784cdce5ffc8dfb707300c34e4f1eb3b8a14f1
-F Makefile.linux-gcc 06be33b2a9ad4f005a5f42b22c4a19dab3cbb5c7
+F Makefile.linux-gcc aee18d8a05546dcf1888bd4547e442008a49a092
 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
 F VERSION b818cce180263e590a00ad4509a713892c3eecea
 F aclocal.m4 7daea4c35e88de30d5a3f6f7a2ab99720e803bbd
@@ -11,8 +11,8 @@ F art/SQLite.gif 1bbb94484963f1382e27e1c5e86dd0c1061eba2b
 F art/SQLiteLogo3.tiff b9e6bf022ae939bc986cddb8ab99583ca1b02cb3
 F config.guess 2103e94b15dc57112d7b9ee152c6fac5288895b4
 F config.sub 9bf686ec001ae7bc53f5b3563c90c62d4c6d48be
-F configure b03b598fb77785964f40a8095e41cf0ea36f5ccd x
-F configure.ac e326bf833811b30229c996a0086c4ce563be7caa
+F configure 91136fc4891444dc6312f3af90217fcce3d89d75 x
+F configure.ac ab85efcbdbbf3389908fc6294b82f233e8f85165
 F contrib/sqlitecon.tcl 210a913ad63f9f991070821e599d600bd913e0ad
 F doc/lemon.html f0f682f50210928c07e562621c3b7e8ab912a538
 F doc/report1.txt a031aaf37b185e4fa540223cb516d3bccec7eeac
@@ -53,7 +53,7 @@ F src/os.h c51f2747f7bd1840447e2c7d26db749604626814
 F src/os_common.h 1ff88c7e7e6bd3e5f85443106c91cc26a4f8600b
 F src/os_test.c 49833426101f99aee4bb5f6a44b7c4b2029fda1c
 F src/os_test.h 903c93554c23d88f34f667f1979e4a1cee792af3
-F src/os_unix.c 407dd07818d13807c396acf3f7570af81cbb666c
+F src/os_unix.c 23d6c04d08dbf712447e490c1451e3acd2d4ea2a
 F src/os_unix.h 5768d56d28240d3fe4537fac08cc85e4fb52279e
 F src/os_win.c fbccc85e7011174068c27d54256746321a1f0059
 F src/os_win.h 41a946bea10f61c158ce8645e7646b29d44f122b
@@ -314,7 +314,7 @@ F www/tclsqlite.tcl ddcf912ea48695603c8ed7efb29f0812ef8d1b49
 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
 F www/version3.tcl a99cf5f6d8bd4d5537584a2b342f0fb9fa601d8b
 F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513
-P 385a08afefaf552db221ae8bd30ecc7e7c07ee5b
-R 2ecda0d10d1a481ae25122b53decdec9
+P 6d4bc8f83b228b3804fffcb17ac57e1f754fa9cd
+R 2a81a5e046bb12e6c133d1e450e99468
 U drh
-Z 95a343ba23b58fd399ed48f71453c638
+Z 6df1f50e225442ff181a6694bcabfb37
index f6fbd20cb3d74a68074d3c1633a4bace849be745..eef0929bc18e4b71f382a36e26d0fc94cd56afac 100644 (file)
@@ -1 +1 @@
-6d4bc8f83b228b3804fffcb17ac57e1f754fa9cd
\ No newline at end of file
+115340d4e85f1bbbab657edbb504284343d86e2c
\ No newline at end of file
index f4e09b5364b4feaea09c06fb459acd12c8c04cf5..3e7a7b1539e71fe03ad314f3e4faa490b6a5f742 100644 (file)
@@ -788,6 +788,14 @@ int sqlite3_sync_count = 0;
 int sqlite3_fullsync_count = 0;
 #endif
 
+/*
+** Use the fdatasync() API only if the HAVE_FDATASYNC macro is defined.
+** Otherwise use fsync() in its place.
+*/
+#ifndef HAVE_FDATASYNC
+# define fdatasync fsync
+#endif
+
 
 /*
 ** The fsync() system call does not work as advertised on many
@@ -829,12 +837,9 @@ static int full_fsync(int fd, int fullSync, int dataOnly){
   if( rc ) rc = fsync(fd);
 
 #else /* if !defined(F_FULLSYNC) */
-#if  defined(_POSIX_SYNCHRONIZED_IO) && _POSIX_SYNCHRONIZED_IO>0
   if( dataOnly ){
     rc = fdatasync(fd);
-  }else
-#endif /* _POSIX_SYNCHRONIZED_IO > 0 */
-  {
+  }else{
     rc = fsync(fd);
   }
 #endif /* defined(F_FULLFSYNC) */