Index: runtime/platform/thread_android.cc |
diff --git a/runtime/platform/thread_android.cc b/runtime/platform/thread_android.cc |
index e789c010a6696533e88ffe6c22afda32b792d38c..20e0e9ec5a4b564e626115aca041dd20cbd2a8ed 100644 |
--- a/runtime/platform/thread_android.cc |
+++ b/runtime/platform/thread_android.cc |
@@ -16,15 +16,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 |