From: Adam Dickmeiss Date: Mon, 6 Jan 2003 21:52:37 +0000 (+0000) Subject: Only use strerror_r in threaded mode X-Git-Tag: YAZ.1.9.2.Roel~6 X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=commitdiff_plain;h=7c40ce6a98bf3d9c2881e7fddbbee7de5811a3a9 Only use strerror_r in threaded mode --- diff --git a/util/nmem.c b/util/nmem.c index 8415772..e2f8cc4 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.39 2003-01-06 08:20:28 adam Exp $ + * $Id: nmem.c,v 1.40 2003-01-06 21:52:37 adam Exp $ */ /* @@ -460,11 +460,17 @@ void yaz_strerror(char *buf, int max) else *buf = '\0'; #else +/* UNIX */ #if HAVE_STRERROR_R +#if YAZ_POSIX_THREADS strerror_r(errno, buf, max); #else strcpy(buf, strerror(yaz_errno())); #endif +#else + strcpy(buf, strerror(yaz_errno())); +#endif +/* UNIX */ #endif if ((cp=strrchr(buf, '\n'))) *cp = '\0';