Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1864)

Unified Diff: runtime/platform/thread_android.cc

Issue 22634003: Replaced strerror() calls with threadsafe strerror_r() (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/utils_macos.cc ('k') | runtime/platform/thread_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « runtime/bin/utils_macos.cc ('k') | runtime/platform/thread_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698