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

Unified Diff: runtime/bin/file_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/bin/file_linux.cc ('k') | runtime/bin/process_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/file_macos.cc
diff --git a/runtime/bin/file_macos.cc b/runtime/bin/file_macos.cc
index 3cf40de61fc5267b8221b07b2669f4a38ebc8249..7b3815aa0feeb8baf3ce9814ac10133911f996a0 100644
--- a/runtime/bin/file_macos.cc
+++ b/runtime/bin/file_macos.cc
@@ -319,7 +319,10 @@ File::StdioHandleType File::GetStdioHandleType(int fd) {
struct stat buf;
int result = fstat(fd, &buf);
if (result == -1) {
- FATAL2("Failed stat on file descriptor %d: %s", fd, strerror(errno));
+ const int kBufferSize = 1024;
+ char error_message[kBufferSize];
+ strerror_r(errno, error_message, kBufferSize);
+ FATAL2("Failed stat on file descriptor %d: %s", fd, error_message);
}
if (S_ISCHR(buf.st_mode)) return kTerminal;
if (S_ISFIFO(buf.st_mode)) return kPipe;
« no previous file with comments | « runtime/bin/file_linux.cc ('k') | runtime/bin/process_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698