]> code.delx.au - gnu-emacs/commitdiff
Guard against potential configure bug wrt HAVE_GETWD
authorGlenn Morris <rgm@gnu.org>
Mon, 6 Aug 2012 20:29:45 +0000 (16:29 -0400)
committerGlenn Morris <rgm@gnu.org>
Mon, 6 Aug 2012 20:29:45 +0000 (16:29 -0400)
* configure.ac (BROKEN_GETWD) [unixware]: New define.

* src/sysdep.c: Respect BROKEN_GETWD.

ChangeLog
configure.ac
src/ChangeLog
src/sysdep.c

index f5883f9cc00aacff4a992e1dbbe5edca479d004a..48ba569326ffb7ae3e790e77196cf2ddcf26c27d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2012-08-06  Glenn Morris  <rgm@gnu.org>
 
+       * configure.ac (BROKEN_GETWD) [unixware]: New define.
+
        * configure.ac (GNU_LIBRARY_PENDING_OUTPUT_COUNT): Remove.
        (PENDING_OUTPUT_COUNT): Absorb GNU_LIBRARY_PENDING_OUTPUT_COUNT.
        (DISPNEW_NEEDS_STDIO_EXT): New define.
index b4fe8bc0b9f68e3c165d41779211f8a5e47a12a0..81d80a59414a63fc29cd84a313023b802e5625e5 100644 (file)
@@ -2724,10 +2724,11 @@ getpwent endpwent getgrent endgrent \
 touchlock \
 cfmakeraw cfsetspeed copysign __executable_start)
 
-dnl FIXME Fragile: something else may test for getwd as a dependency.
-dnl Change to defining BROKEN_xxx ?
 dnl getwd appears to be buggy on SVR4.2, so we don't use it.
-if test $opsys != unixware; then
+if test $opsys = unixware; then
+  dnl In case some other test ends up checking for getwd.
+  AC_DEFINE(BROKEN_GETWD, 1, [Define if getwd should not be used.])
+else
   AC_CHECK_FUNCS(getwd)
 fi
 
index ec3f08fc6a0adda8ce125302a8e936e431329aa9..5bccda264b2ce8dbe22635c6c9e1fbd126be060e 100644 (file)
@@ -1,5 +1,7 @@
 2012-08-06  Glenn Morris  <rgm@gnu.org>
 
+       * sysdep.c: Respect BROKEN_GETWD.
+
        * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
        Let configure handle it.
        (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
index b2b3556d1255de061ea7fb44f21265a57880b20e..d9e239d77c3cd46aa498685bcb7c42c291ad1933 100644 (file)
@@ -1971,7 +1971,7 @@ emacs_readlink (char const *filename, char initial_buf[READLINK_BUFSIZE])
  *     under error conditions.
  */
 
-#ifndef HAVE_GETWD
+#if !defined (HAVE_GETWD) || defined (BROKEN_GETWD)
 
 #ifndef MAXPATHLEN
 /* In 4.1, param.h fails to define this.  */
@@ -2001,7 +2001,7 @@ getwd (char *pathname)
   return pathname;
 }
 
-#endif /* HAVE_GETWD */
+#endif /* !defined (HAVE_GETWD) || defined (BROKEN_GETWD) */
 
 /*
  *     This function will go away as soon as all the stubs fixed. (fnf)