libreplace: add fdatasync() if not available
authorAndrew Tridgell <tridge@samba.org>
Sat, 13 Feb 2010 01:57:13 +0000 (12:57 +1100)
committerAndrew Tridgell <tridge@samba.org>
Sat, 13 Feb 2010 11:36:11 +0000 (22:36 +1100)
lib/replace/libreplace.m4
lib/replace/replace.h

index 7a26deb6119bfc8239cdb4a1e80badd74655cc6b..d7873dbb67b407627d80d7ef2bde7958b76fc2e5 100644 (file)
@@ -109,7 +109,7 @@ AC_CHECK_FUNCS(seteuid setresuid setegid setresgid chroot bzero strerror)
 AC_CHECK_FUNCS(vsyslog setlinebuf mktime ftruncate chsize rename)
 AC_CHECK_FUNCS(waitpid wait4 strlcpy strlcat initgroups memmove strdup)
 AC_CHECK_FUNCS(pread pwrite strndup strcasestr strtok_r mkdtemp dup2 dprintf vdprintf)
-AC_CHECK_FUNCS(isatty chown lchown link readlink symlink realpath)
+AC_CHECK_FUNCS(isatty chown lchown link readlink symlink realpath fdatasync)
 AC_HAVE_DECL(setresuid, [#include <unistd.h>])
 AC_HAVE_DECL(setresgid, [#include <unistd.h>])
 AC_HAVE_DECL(errno, [#include <errno.h>])
index baf2368130c6342af2d164c0442a88e5d2d59199..a4ef231385ef73cfd53b9f49198d609c98a91352 100644 (file)
@@ -729,4 +729,8 @@ char *ufc_crypt(const char *key, const char *salt);
 #endif
 #endif
 
+#ifndef HAVE_FDATASYNC
+#define fdatasync(fd) fsync(fd)
+#endif
+
 #endif /* _LIBREPLACE_REPLACE_H */