You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mt...@apache.org on 2009/04/14 11:47:18 UTC
svn commit: r764725 -
/commons/sandbox/runtime/trunk/src/main/native/shared/error.c
Author: mturk
Date: Tue Apr 14 09:47:18 2009
New Revision: 764725
URL: http://svn.apache.org/viewvc?rev=764725&view=rev
Log:
Use correct strerror_r function
Modified:
commons/sandbox/runtime/trunk/src/main/native/shared/error.c
Modified: commons/sandbox/runtime/trunk/src/main/native/shared/error.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/error.c?rev=764725&r1=764724&r2=764725&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/error.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/error.c Tue Apr 14 09:47:18 2009
@@ -230,7 +230,7 @@
#if defined(WIN32)
/* Winsock error strings
- *
+ *
*/
static const struct {
int code;
@@ -383,12 +383,17 @@
acr_size_t bufsize)
{
const char *msg;
-
+#ifdef _GNU_SOURCE
buf[0] = '\0';
msg = strerror_r(statcode, buf, bufsize);
if (buf[0] == '\0') { /* libc didn't use our buffer */
return stuffbuffer(buf, bufsize, msg);
}
+#else
+ if (!strerror_r(statcode, buf, bufsize)) {
+ return buf;
+ }
+#endif
else {
return buf;
}