Index: runtime/platform/thread_macos.cc |
diff --git a/runtime/platform/thread_macos.cc b/runtime/platform/thread_macos.cc |
index 29059fe4ca910270230be83b824de669f97dd43d..e9c6dfc38e85987b61ce4a52414bbafc26e88bda 100644 |
--- a/runtime/platform/thread_macos.cc |
+++ b/runtime/platform/thread_macos.cc |
@@ -15,15 +15,21 @@ namespace dart { |
#define VALIDATE_PTHREAD_RESULT(result) \ |
if (result != 0) { \ |
- FATAL2("pthread error: %d (%s)", result, strerror(result)); \ |
+ const int kBufferSize = 1024; \ |
+ char error_message[kBufferSize]; \ |
+ strerror_r(result, error_message, kBufferSize); \ |
+ FATAL2("pthread error: %d (%s)", result, error_message); \ |
} |
#ifdef DEBUG |
#define RETURN_ON_PTHREAD_FAILURE(result) \ |
if (result != 0) { \ |
+ const int kBufferSize = 1024; \ |
+ char error_message[kBufferSize]; \ |
+ strerror_r(result, error_message, kBufferSize); \ |
fprintf(stderr, "%s:%d: pthread error: %d (%s)\n", \ |
- __FILE__, __LINE__, result, strerror(result)); \ |
+ __FILE__, __LINE__, result, error_message); \ |
return result; \ |
} |
#else |