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

Unified Diff: runtime/platform/thread_linux.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_android.cc ('k') | runtime/platform/thread_macos.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/platform/thread_linux.cc
diff --git a/runtime/platform/thread_linux.cc b/runtime/platform/thread_linux.cc
index dd02a387531b5a111ee5528c346f3b406732f5bd..acb78c71ed5423a0daeebcde32bb5c959b74adca 100644
--- a/runtime/platform/thread_linux.cc
+++ b/runtime/platform/thread_linux.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_buf[kBufferSize]; \
+ FATAL2("pthread error: %d (%s)", result, \
+ strerror_r(result, error_buf, kBufferSize)); \
}
#ifdef DEBUG
#define RETURN_ON_PTHREAD_FAILURE(result) \
if (result != 0) { \
+ const int kBufferSize = 1024; \
+ char error_buf[kBufferSize]; \
fprintf(stderr, "%s:%d: pthread error: %d (%s)\n", \
- __FILE__, __LINE__, result, strerror(result)); \
+ __FILE__, __LINE__, result, \
+ strerror_r(result, error_buf, kBufferSize)); \
return result; \
}
#else
« no previous file with comments | « runtime/platform/thread_android.cc ('k') | runtime/platform/thread_macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698