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

Unified Diff: runtime/bin/eventhandler_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/dbg_connection_macos.cc ('k') | runtime/bin/eventhandler_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/eventhandler_android.cc
diff --git a/runtime/bin/eventhandler_android.cc b/runtime/bin/eventhandler_android.cc
index 258a96b2112ca957e2d3ef686dbf86c73ad2db1b..90f94b41be3fd8c69a3a82ffa70e3beafa0daf9e 100644
--- a/runtime/bin/eventhandler_android.cc
+++ b/runtime/bin/eventhandler_android.cc
@@ -88,7 +88,10 @@ static void UpdateEpollInstance(intptr_t epoll_fd_, SocketData* sd) {
sd->set_tracked_by_epoll(true);
}
if (status == -1) {
- FATAL1("Failed updating epoll instance: %s", strerror(errno));
+ const int kBufferSize = 1024;
+ char error_message[kBufferSize];
+ strerror_r(errno, error_message, kBufferSize);
+ FATAL1("Failed updating epoll instance: %s", error_message);
}
}
}
@@ -306,7 +309,10 @@ intptr_t EventHandlerImplementation::GetPollEvents(intptr_t events,
event_mask = (1 << kCloseEvent);
sd->MarkClosedRead();
} else if (errno != EWOULDBLOCK) {
- Log::PrintErr("Error recv: %s\n", strerror(errno));
+ const int kBufferSize = 1024;
+ char error_message[kBufferSize];
+ strerror_r(errno, error_message, kBufferSize);
+ Log::PrintErr("Error recv: %s\n", error_message);
}
}
}
« no previous file with comments | « runtime/bin/dbg_connection_macos.cc ('k') | runtime/bin/eventhandler_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698