From 959a3651b9c62f4d40880b3055f9a4c8ed182178 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Mon, 2 Jan 2006 09:46:49 +0000 Subject: [PATCH] fix logic of POSIX strerror_r (ITS#4292; refix ITS#4285) --- include/ac/string.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/ac/string.h b/include/ac/string.h index f91f04035c..49075a2782 100644 --- a/include/ac/string.h +++ b/include/ac/string.h @@ -106,14 +106,14 @@ void * memrchr(const void *b, int c, size_t len); #if defined( HAVE_NONPOSIX_STRERROR_R ) # define AC_STRERROR_R(e,b,l) (strerror_r((e), (b), (l))) #elif defined( HAVE_STRERROR_R ) -# define AC_STRERROR_R(e,b,l) (strerror_r((e), (b), (l)) ? (b) : "") +# define AC_STRERROR_R(e,b,l) (strerror_r((e), (b), (l)) == 0 ? (b) : "Unknown error") #elif defined( HAVE_SYS_ERRLIST ) # define AC_STRERROR_R(e,b,l) ((e) > -1 && (e) < sys_nerr \ - ? sys_errlist[(e)] : "" ) + ? sys_errlist[(e)] : "Unknown error" ) #elif defined( HAVE_STRERROR ) -# define AC_STRERROR_R(e,b,l) (strerror(e)) +# define AC_STRERROR_R(e,b,l) (strerror(e)) /* NOTE: may be NULL */ #else -# define AC_STRERROR_R(e,b,l) ("") +# define AC_STRERROR_R(e,b,l) ("Unknown error") #endif #endif /* _AC_STRING_H */ -- 2.39.5