From 2723d9b56e2ea15c0c753ae579849806102f4ce0 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 2 Feb 2010 11:57:49 +0000 Subject: [PATCH] * If fdatasync() isn't available, use fsync(). --- configure.ac | 1 + src/libutil/util.hh | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/configure.ac b/configure.ac index 46036113b..f6d983fda 100644 --- a/configure.ac +++ b/configure.ac @@ -262,6 +262,7 @@ 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.hh b/src/libutil/util.hh index 837382433..90132da73 100644 --- a/src/libutil/util.hh +++ b/src/libutil/util.hh @@ -12,6 +12,10 @@ #include +#ifndef HAVE_FDATASYNC +#define fdatasync fsync +#endif + namespace nix {