From: Pierangelo Masarati Date: Mon, 2 Jan 2006 09:46:49 +0000 (+0000) Subject: fix logic of POSIX strerror_r (ITS#4292; refix ITS#4285) X-Git-Tag: OPENLDAP_REL_ENG_2_4_BP~489 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=959a3651b9c62f4d40880b3055f9a4c8ed182178;p=openldap fix logic of POSIX strerror_r (ITS#4292; refix ITS#4285) --- 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 */