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

Unified Diff: runtime/platform/thread_macos.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/platform/thread_linux.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « runtime/platform/thread_linux.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698