[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: working strerror_r not properly detected
From: |
exg |
Subject: |
Re: working strerror_r not properly detected |
Date: |
Mon, 26 Jun 2006 10:35:21 +0200 |
User-agent: |
Mutt/1.5.11-2006-06-08 |
> Having built grep from CVS, I hit a problem: when trying to search a
> pattern in a non-existent file, it produces this message:
>
> src/grep: notafile: []
>
> where the [] is some unprintable unicode character. This happens
> because in line 170 of lib/error.c HAVE_WORKING_STRERROR_R appears
> not to be defined. (When I define it, it works as it should.) But
> during ./configure it seems to be detected okay:
>
> checking whether strerror_r returns char *... yes
>
> What is going wrong here?
That's because it is not using the macro in m4/strerror_r.m4 but the one
included in autoconf-2.5, which defines STRERROR_R_CHAR_P instead; the
attached patch should fix it.
--
Emanuele Giaquinta
Index: lib/error.c
===================================================================
RCS file: /sources/grep/grep/lib/error.c,v
retrieving revision 1.2
diff -u -b -B -r1.2 error.c
--- lib/error.c 2 May 2005 09:47:48 -0000 1.2
+++ lib/error.c 26 Jun 2006 08:27:53 -0000
@@ -167,7 +167,7 @@
{
#if defined HAVE_STRERROR_R || _LIBC
char errbuf[1024];
-# if HAVE_WORKING_STRERROR_R || _LIBC
+# if STRERROR_R_CHAR_P || _LIBC
fprintf (stderr, ": %s", __strerror_r (errnum, errbuf, sizeof errbuf));
# else
/* Don't use __strerror_r's return value because on some systems