logo       

Re: [patch]: fix ia64 SIGSEGV in coreutils 4.5.9: msg#00046

gnu.core-utils.bugs

Subject: Re: [patch]: fix ia64 SIGSEGV in coreutils 4.5.9

David Kimdon <dwhedon@xxxxxxxxxx> wrote:
> The included patch fixes the Debian ia64 build failure for coreutils-4.5.9
> reported here:
>
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=183962

Thanks a lot for the nice report and fix.
I've fixed that slightly differently for 4.5.10.

2003-03-07 Jim Meyering <jim@xxxxxxxxxxxx>

* getcwd.c: #undef getcwd only after *all* included header files.
Declare getcwd unconditionally. The problem was that same.h
included config.h, and that defined getcwd to rpl_getcwd a second
time (after the original #undef), and led to the rpl_getcwd
function calling itself endlessly. This was the cause of at least
the `du' test failures on IRIX 6.5, reported by Nelson Beebe.

Index: lib/getcwd.c
===================================================================
RCS file: /fetish/cu/lib/getcwd.c,v
retrieving revision 1.2
retrieving revision 1.5
diff -u -p -u -p -r1.2 -r1.5
--- lib/getcwd.c 5 Mar 2003 08:19:10 -0000 1.2
+++ lib/getcwd.c 7 Mar 2003 10:13:55 -0000 1.5
@@ -32,16 +32,20 @@ extern int errno;
#include "pathmax.h"
#include "same.h"

-/* Undefine getcwd here so any prototype is not redefined to be a
- prototype for rpl_getcwd. */
-#undef getcwd
-
/* Guess high, because that makes the test below more conservative.
But this is a kludge, because we should really use
pathconf (".", _PC_NAME_MAX). But it's probably not worth the cost. */
#define KLUDGE_POSIX_NAME_MAX 255

#define MAX_SAFE_LEN (PATH_MAX - 1 - KLUDGE_POSIX_NAME_MAX - 1)
+
+/* Undefine getcwd here, as near the use as possible, in case any
+ of the files included above define it to rpl_getcwd. */
+#undef getcwd
+
+/* Any declaration of getcwd from headers included above has
+ been changed to a declaration of rpl_getcwd. Declare it here. */
+extern char *getcwd (char *buf, size_t size);

/* This is a wrapper for getcwd.
Some implementations (at least GNU libc 2.3.1 + linux-2.4.20) return


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise