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

  1. diff -urN a/lib/err/errPosix.c b/lib/err/errPosix.c
  2. --- a/lib/err/errPosix.c
  3. +++ b/lib/err/errPosix.c
  4. @@ -31,6 +31,7 @@
  5. #include <errno.h>
  6. #include <string.h>
  7. #include <locale.h>
  8. +#include <stdio.h>
  9. #include "vmware.h"
  10. #include "errInt.h"
  11. @@ -63,11 +64,13 @@
  12. {
  13. char *p;
  14. -#if defined(__linux__) && !defined(__ANDROID__)
  15. +#if defined(__GLIBC__) && !defined(__ANDROID__)
  16. p = strerror_r(errorNumber, buf, bufSize);
  17. #else
  18. - p = strerror(errorNumber);
  19. -#endif
  20. + if (strerror_r(errorNumber, buf, bufSize) != 0)
  21. + snprintf(buf, bufSize, "unknown error %i", errorNumber);
  22. + p = buf;
  23. +#endif /* defined __GLIBC__ */
  24. ASSERT(p != NULL);
  25. return p;
  26. }