* Remove the fdatasync check since it's no longer needed.

This commit is contained in:
Eelco Dolstra 2010-02-24 12:16:50 +00:00
parent bb82310dba
commit 5954eadf67
3 changed files with 2 additions and 8 deletions

View file

@ -279,7 +279,6 @@ AC_CHECK_FUNCS([setresuid setreuid lchown])
# Nice to have, but not essential. # Nice to have, but not essential.
AC_CHECK_FUNCS([strsignal]) AC_CHECK_FUNCS([strsignal])
AC_CHECK_FUNCS([posix_fallocate]) AC_CHECK_FUNCS([posix_fallocate])
AC_CHECK_FUNCS([fdatasync])
# This is needed if ATerm or bzip2 are static libraries, # This is needed if ATerm or bzip2 are static libraries,

View file

@ -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); AutoCloseFD fd = open(path.c_str(), O_WRONLY | O_TRUNC | O_CREAT, 0666);
if (fd == -1) if (fd == -1)
throw SysError(format("opening file `%1%'") % path); throw SysError(format("opening file `%1%'") % path);
writeFull(fd, (unsigned char *) s.c_str(), s.size()); writeFull(fd, (unsigned char *) s.c_str(), s.size());
if (doFsync) fdatasync(fd);
} }

View file

@ -12,10 +12,6 @@
#include <cstdio> #include <cstdio>
#ifndef HAVE_FDATASYNC
#define fdatasync fsync
#endif
namespace nix { namespace nix {
@ -66,7 +62,7 @@ string readFile(int fd);
string readFile(const Path & path); string readFile(const Path & path);
/* Write a string to a file. */ /* 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. */ /* Read a line from a file descriptor. */
string readLine(int fd); string readLine(int fd);