projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Towards 2.0.3
[yaz-moved-to-github.git]
/
util
/
nmem.c
diff --git
a/util/nmem.c
b/util/nmem.c
index
8415772
..
b546b8f
100644
(file)
--- a/
util/nmem.c
+++ b/
util/nmem.c
@@
-3,7
+3,7
@@
* See the file LICENSE for details.
* Sebastian Hammer, Adam Dickmeiss
*
* 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.41 2003-02-22 00:08:44 adam Exp $
*/
/*
*/
/*
@@
-460,11
+460,21
@@
void yaz_strerror(char *buf, int max)
else
*buf = '\0';
#else
else
*buf = '\0';
#else
+/* UNIX */
#if HAVE_STRERROR_R
#if HAVE_STRERROR_R
+#if YAZ_POSIX_THREADS
+ *buf = '\0';
strerror_r(errno, buf, max);
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
#else
strcpy(buf, strerror(yaz_errno()));
#endif
#else
strcpy(buf, strerror(yaz_errno()));
#endif
+/* UNIX */
#endif
if ((cp=strrchr(buf, '\n')))
*cp = '\0';
#endif
if ((cp=strrchr(buf, '\n')))
*cp = '\0';