diff options
-rw-r--r-- | configure.ac | 1 | ||||
-rw-r--r-- | src/libstore/local-store.cc | 4 | ||||
-rw-r--r-- | src/libutil/util.cc | 2 | ||||
-rw-r--r-- | src/libutil/util.hh | 6 |
4 files changed, 3 insertions, 10 deletions
diff --git a/configure.ac b/configure.ac index f6d983fda8..46036113b8 100644 --- a/configure.ac +++ b/configure.ac @@ -262,7 +262,6 @@ AC_CHECK_FUNCS([setresuid setreuid lchown]) # Nice to have, but not essential. AC_CHECK_FUNCS([strsignal]) AC_CHECK_FUNCS([posix_fallocate]) -AC_CHECK_FUNCS([fdatasync]) # This is needed if ATerm or bzip2 are static libraries, diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc index 7c8db745cb..a83ba55e2b 100644 --- a/src/libstore/local-store.cc +++ b/src/libstore/local-store.cc @@ -240,7 +240,7 @@ void LocalStore::appendReferrer(const Path & from, const Path & to, bool lock) string s = " " + to; writeFull(fd, (const unsigned char *) s.c_str(), s.size()); - if (doFsync) fdatasync(fd); + if (doFsync) fsync(fd); } @@ -271,7 +271,7 @@ void LocalStore::rewriteReferrers(const Path & path, bool purge, PathSet referre writeFull(fd, (const unsigned char *) s.c_str(), s.size()); - if (doFsync) fdatasync(fd); + if (doFsync) fsync(fd); fd.close(); /* for Windows; can't rename open file */ diff --git a/src/libutil/util.cc b/src/libutil/util.cc index 8c52625a25..eec60867df 100644 --- a/src/libutil/util.cc +++ b/src/libutil/util.cc @@ -233,7 +233,7 @@ void writeFile(const Path & path, const string & s, bool doFsync) if (fd == -1) throw SysError(format("opening file `%1%'") % path); writeFull(fd, (unsigned char *) s.c_str(), s.size()); - if (doFsync) fdatasync(fd); + if (doFsync) fsync(fd); } diff --git a/src/libutil/util.hh b/src/libutil/util.hh index 90132da733..f609e8944b 100644 --- a/src/libutil/util.hh +++ b/src/libutil/util.hh @@ -1,8 +1,6 @@ #ifndef __UTIL_H #define __UTIL_H -#include "config.h" - #include "types.hh" #include <sys/types.h> @@ -12,10 +10,6 @@ #include <cstdio> -#ifndef HAVE_FDATASYNC -#define fdatasync fsync -#endif - namespace nix { |