You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

28 lines
676 B

diff -urN a/lib/err/errPosix.c b/lib/err/errPosix.c
--- a/lib/err/errPosix.c
+++ b/lib/err/errPosix.c
@@ -31,6 +31,7 @@
#include <errno.h>
#include <string.h>
#include <locale.h>
+#include <stdio.h>
#include "vmware.h"
#include "errInt.h"
@@ -63,11 +64,13 @@
{
char *p;
-#if defined(__linux__) && !defined(__ANDROID__)
+#if defined(__GLIBC__) && !defined(__ANDROID__)
p = strerror_r(errorNumber, buf, bufSize);
#else
- p = strerror(errorNumber);
-#endif
+ if (strerror_r(errorNumber, buf, bufSize) != 0)
+ snprintf(buf, bufSize, "unknown error %i", errorNumber);
+ p = buf;
+#endif /* defined __GLIBC__ */
ASSERT(p != NULL);
return p;
}