apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1790200 - in /apr/apr/trunk: configure.in file_io/unix/readwrite.c
Date Wed, 05 Apr 2017 10:18:57 GMT
Author: brane
Date: Wed Apr  5 10:18:57 2017
New Revision: 1790200

URL: http://svn.apache.org/viewvc?rev=1790200&view=rev
Log:
Do not try to use fdatasync() on macOS.
Use the platform-specific fcntl(fd, F_FULLFSYNC) instead.

See http://apr.markmail.org/thread/hlgqd5yr6j4auxol

Modified:
    apr/apr/trunk/configure.in
    apr/apr/trunk/file_io/unix/readwrite.c

Modified: apr/apr/trunk/configure.in
URL: http://svn.apache.org/viewvc/apr/apr/trunk/configure.in?rev=1790200&r1=1790199&r2=1790200&view=diff
==============================================================================
--- apr/apr/trunk/configure.in (original)
+++ apr/apr/trunk/configure.in Wed Apr  5 10:18:57 2017
@@ -578,6 +578,11 @@ case $host in
              ;;
        esac
        ;;
+   *apple-darwin*)
+       ac_cv_func_fdatasync="no" # Mac OS X wrongly reports it has fdatasync()
+       OSDIR="unix"
+       eolstr="\\n"
+       ;;
    *os390)
        OSDIR="os390"
        OBJECTS_PLATFORM='$(OBJECTS_os390)'

Modified: apr/apr/trunk/file_io/unix/readwrite.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/file_io/unix/readwrite.c?rev=1790200&r1=1790199&r2=1790200&view=diff
==============================================================================
--- apr/apr/trunk/file_io/unix/readwrite.c (original)
+++ apr/apr/trunk/file_io/unix/readwrite.c Wed Apr  5 10:18:57 2017
@@ -476,6 +476,8 @@ APR_DECLARE(apr_status_t) apr_file_datas
 
 #ifdef HAVE_FDATASYNC
     if (fdatasync(thefile->filedes)) {
+#elif defined(F_FULLFSYNC)
+    if (fcntl(thefile->filedes, F_FULLFSYNC)) {
 #else
     if (fsync(thefile->filedes)) {
 #endif



Mime
View raw message