summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2011-07-22 13:40:03 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2011-07-22 13:41:19 -0700
commit339613b6bdd8d4a51435cba9e903b8b5bb082da4 (patch)
tree170c9516716a58b4a3c85414094dfcc74601045d
parentf603b2d228e4f5ea811c17470361b683e4fee1ee (diff)
downloadcoreutils-339613b6bdd8d4a51435cba9e903b8b5bb082da4.tar.xz
dd, shred: use fdatasync only if declared
* m4/jm-macros.m4 (coreutils_MACROS): Use fdatasync only if declared. MacOS X 10.7 has an fdatasync that is not declared, and is rumored to be ineffective. (Bug#9141)
-rw-r--r--m4/jm-macros.m414
1 files changed, 10 insertions, 4 deletions
diff --git a/m4/jm-macros.m4 b/m4/jm-macros.m4
index 6e9722100..58b000d3f 100644
--- a/m4/jm-macros.m4
+++ b/m4/jm-macros.m4
@@ -93,14 +93,20 @@ AC_DEFUN([coreutils_MACROS],
cu_PREREQ_STAT_PROG
# for dd.c and shred.c
- coreutils_saved_libs=$LIBS
- LIB_FDATASYNC=
+ #
+ # Use fdatasync only if declared. On MacOS X 10.7, fdatasync exists but
+ # is not declared, and is ineffective.
+ LIB_FDATASYNC=
+ AC_SUBST([LIB_FDATASYNC])
+ AC_CHECK_DECLS_ONCE([fdatasync])
+ if test $ac_cv_have_decl_fdatasync = yes; then
+ coreutils_saved_libs=$LIBS
AC_SEARCH_LIBS([fdatasync], [rt posix4],
[test "$ac_cv_search_fdatasync" = "none required" ||
LIB_FDATASYNC=$ac_cv_search_fdatasync])
- AC_SUBST([LIB_FDATASYNC])
AC_CHECK_FUNCS([fdatasync])
- LIBS=$coreutils_saved_libs
+ LIBS=$coreutils_saved_libs
+ fi
# Check whether libcap is usable -- for ls --color support
LIB_CAP=