From cfd0664043248f6e52ffa6265a0c430658d04370 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Sat, 22 Feb 2003 00:08:44 +0000 Subject: [PATCH] work around for bug in strerror_r --- util/nmem.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/util/nmem.c b/util/nmem.c index e2f8cc4..b546b8f 100644 --- a/util/nmem.c +++ b/util/nmem.c @@ -3,7 +3,7 @@ * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * - * $Id: nmem.c,v 1.40 2003-01-06 21:52:37 adam Exp $ + * $Id: nmem.c,v 1.41 2003-02-22 00:08:44 adam Exp $ */ /* @@ -463,7 +463,11 @@ void yaz_strerror(char *buf, int max) /* UNIX */ #if HAVE_STRERROR_R #if YAZ_POSIX_THREADS + *buf = '\0'; strerror_r(errno, buf, max); + /* if buffer is unset - use strerror anyway (GLIBC bug) */ + if (*buf == '\0') + strcpy(buf, strerror(yaz_errno())); #else strcpy(buf, strerror(yaz_errno())); #endif -- 1.7.10.4