summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-02-13 12:57:13 +1100
committerAndrew Tridgell <tridge@samba.org>2010-02-13 22:36:11 +1100
commitf435538576878cca81af42e34979a6e4125fe136 (patch)
treec5897c123fa7968e65d8b4e983a2c0eecc1b9142
parent63844609dafb58860a4058bbd7fee10b1f69876b (diff)
downloadsamba-f435538576878cca81af42e34979a6e4125fe136.tar.gz
samba-f435538576878cca81af42e34979a6e4125fe136.tar.bz2
samba-f435538576878cca81af42e34979a6e4125fe136.zip
libreplace: add fdatasync() if not available
-rw-r--r--lib/replace/libreplace.m42
-rw-r--r--lib/replace/replace.h4
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/replace/libreplace.m4 b/lib/replace/libreplace.m4
index 7a26deb611..d7873dbb67 100644
--- a/lib/replace/libreplace.m4
+++ b/lib/replace/libreplace.m4
@@ -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>])
diff --git a/lib/replace/replace.h b/lib/replace/replace.h
index baf2368130..a4ef231385 100644
--- a/lib/replace/replace.h
+++ b/lib/replace/replace.h
@@ -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 */