delete trailing whitespace from control files
[debian/gzip] / m4 / open.m4
index c85971dc1ad795798bf4b597988e9a20212a2495..8b3d4024e1171845caff28c6be681569b64de5b5 100644 (file)
@@ -1,5 +1,5 @@
-# open.m4 serial 13
-dnl Copyright (C) 2007-2012 Free Software Foundation, Inc.
+# open.m4 serial 15
+dnl Copyright (C) 2007-2018 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -7,6 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_FUNC_OPEN],
 [
   AC_REQUIRE([AC_CANONICAL_HOST])
+  AC_REQUIRE([gl_PREPROC_O_CLOEXEC])
   case "$host_os" in
     mingw* | pw*)
       REPLACE_OPEN=1
@@ -15,6 +16,9 @@ AC_DEFUN([gl_FUNC_OPEN],
       dnl open("foo/") should not create a file when the file name has a
       dnl trailing slash.  FreeBSD only has the problem on symlinks.
       AC_CHECK_FUNCS_ONCE([lstat])
+      if test "$gl_cv_macro_O_CLOEXEC" != yes; then
+        REPLACE_OPEN=1
+      fi
       AC_CACHE_CHECK([whether open recognizes a trailing slash],
         [gl_cv_func_open_slash],
         [# Assume that if we have lstat, we can also check symlinks.
@@ -86,7 +90,6 @@ changequote([,])dnl
 # Prerequisites of lib/open.c.
 AC_DEFUN([gl_PREREQ_OPEN],
 [
-  AC_REQUIRE([AC_C_INLINE])
   AC_REQUIRE([gl_PROMOTED_TYPE_MODE_T])
   :
 ])