bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

'strerror' test fails on HP-UX 11.00


From: Bruno Haible
Subject: 'strerror' test fails on HP-UX 11.00
Date: Fri, 26 Oct 2007 12:08:40 +0200
User-agent: KMail/1.5.4

Hi Eric,

Seen on HP-UX 11.00:

test-strerror.c:52: assertion failed
sh[9]: 4155 Abort
FAIL: test-strerror

In config.status:
  GNULIB_STRERROR = 1
  HAVE_DECL_STRERROR = 1
  REPLACE_STRERROR = 1

In config.h:
/* Define to 1 if you have the declaration of `strerror', and to 0 if you
#define HAVE_DECL_STRERROR 1
/* Define this to 1 if strerror is broken. */
#define REPLACE_STRERROR 1

This patch fixes it for me. OK to commit?


2007-10-26  Bruno Haible  <address@hidden>

        * lib/strerror.c (rpl_strerror): Return "Unknown error ..." also if
        strerror returned the empty string. Needed on HP-UX 11.00.

--- lib/strerror.c.orig 2007-10-26 12:07:52.000000000 +0200
+++ lib/strerror.c      2007-10-26 12:04:57.000000000 +0200
@@ -35,7 +35,7 @@
 {
   char *result = strerror (n);
 
-  if (! result)
+  if (result == NULL || result[0] == '\0')
     {
       static char const fmt[] = "Unknown error (%d)";
       static char mesg[sizeof fmt + INT_STRLEN_BOUND (n)];





reply via email to

[Prev in Thread] Current Thread [Next in Thread]