open: Remove call-in from fchdir.m4.
authorBruno Haible <bruno@clisp.org>
Mon, 25 Jul 2011 21:31:54 +0000 (23:31 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 25 Jul 2011 21:31:54 +0000 (23:31 +0200)
* m4/open.m4 (gl_FUNC_OPEN): Conditionally invoke gl_TEST_FCHDIR.
* m4/fchdir.m4 (gl_FUNC_FCHDIR): Don't invoke gl_REPLACE_OPEN.

ChangeLog
m4/fchdir.m4
m4/open.m4

index 5e27329692385ef34a0cf2bf76f3a544cedb9ef3..0196accff65c80b25c6b7ba46aa62d3bdde1385e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2011-07-25  Bruno Haible  <bruno@clisp.org>
 
+       open: Remove call-in from fchdir.m4.
+       * m4/open.m4 (gl_FUNC_OPEN): Conditionally invoke gl_TEST_FCHDIR.
+       * m4/fchdir.m4 (gl_FUNC_FCHDIR): Don't invoke gl_REPLACE_OPEN.
+
        fchdir: Start to remove gl_REPLACE_* idiom.
        * m4/fchdir.m4 (gl_TEST_FCHDIR): New macro.
        (gl_FUNC_FCHDIR): Invoke it.
index 92d0f538a86f995102539afe87059b0e5e0a53ff..cc05267ddabd5401b48cdf92451f0dc069bda974 100644 (file)
@@ -27,7 +27,6 @@ AC_DEFUN([gl_FUNC_FCHDIR],
     REPLACE_OPENDIR=1
     REPLACE_CLOSEDIR=1
     REPLACE_DUP=1
-    gl_REPLACE_OPEN
     gl_REPLACE_CLOSE
     gl_REPLACE_DUP2
     dnl dup3 is already unconditionally replaced
index 690cc648d0730279909b28b14f9c504a5ca33999..454eb42a2a55d2fa967b9d26f8f883d15c5f8ac0 100644 (file)
@@ -1,4 +1,4 @@
-# open.m4 serial 12
+# open.m4 serial 13
 dnl Copyright (C) 2007-2011 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -62,6 +62,16 @@ changequote([,])dnl
       esac
       ;;
   esac
+  dnl Replace open() for supporting the gnulib-defined fchdir() function,
+  dnl to keep fchdir's bookkeeping up-to-date.
+  m4_ifdef([gl_FUNC_FCHDIR], [
+    if test $REPLACE_OPEN = 0; then
+      gl_TEST_FCHDIR
+      if test $HAVE_FCHDIR = 0; then
+        gl_REPLACE_OPEN
+      fi
+    fi
+  ])
   dnl Replace open() for supporting the gnulib-defined O_NONBLOCK flag.
   m4_ifdef([gl_NONBLOCKING_IO], [
     if test $REPLACE_OPEN = 0; then