about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--configure.ac1
-rw-r--r--src/libutil/util.cc3
-rw-r--r--src/libutil/util.hh6
3 files changed, 2 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac
index 9d3d9f76eb37..d5db92af3365 100644
--- a/configure.ac
+++ b/configure.ac
@@ -279,7 +279,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/libutil/util.cc b/src/libutil/util.cc
index 8c52625a2531..3f76be670839 100644
--- a/src/libutil/util.cc
+++ b/src/libutil/util.cc
@@ -227,13 +227,12 @@ string readFile(const Path & path)
 }
 
 
-void writeFile(const Path & path, const string & s, bool doFsync)
+void writeFile(const Path & path, const string & s)
 {
     AutoCloseFD fd = open(path.c_str(), O_WRONLY | O_TRUNC | O_CREAT, 0666);
     if (fd == -1)
         throw SysError(format("opening file `%1%'") % path);
     writeFull(fd, (unsigned char *) s.c_str(), s.size());
-    if (doFsync) fdatasync(fd);
 }
 
 
diff --git a/src/libutil/util.hh b/src/libutil/util.hh
index 90132da73317..a3580b547dc6 100644
--- a/src/libutil/util.hh
+++ b/src/libutil/util.hh
@@ -12,10 +12,6 @@
 
 #include <cstdio>
 
-#ifndef HAVE_FDATASYNC
-#define fdatasync fsync
-#endif
-
 
 namespace nix {
 
@@ -66,7 +62,7 @@ string readFile(int fd);
 string readFile(const Path & path);
 
 /* Write a string to a file. */
-void writeFile(const Path & path, const string & s, bool doFsync = false);
+void writeFile(const Path & path, const string & s);
 
 /* Read a line from a file descriptor. */
 string readLine(int fd);