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

Unified Diff: runtime/bin/dbg_connection_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 | « no previous file | runtime/bin/eventhandler_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/dbg_connection_macos.cc
diff --git a/runtime/bin/dbg_connection_macos.cc b/runtime/bin/dbg_connection_macos.cc
index d6766fd664b7a2890d113ca8ca06bd522b0c4d7a..3ee5bf3e92ea5ac6f6010d0112145abaf7a11ed7 100644
--- a/runtime/bin/dbg_connection_macos.cc
+++ b/runtime/bin/dbg_connection_macos.cc
@@ -88,7 +88,10 @@ void DebuggerConnectionImpl::HandleEvent(struct kevent* event) {
int status =
TEMP_FAILURE_RETRY(kevent(kqueue_fd_, &ev_add, 1, NULL, 0, NULL));
if (status == -1) {
- FATAL1("Failed adding debugger socket to kqueue: %s\n", strerror(errno));
+ const int kBufferSize = 1024;
+ char error_message[kBufferSize];
+ strerror_r(errno, error_message, kBufferSize);
+ FATAL1("Failed adding debugger socket to kqueue: %s\n", error_message);
}
*/
} else if (ident == wakeup_fds_[0]) {
@@ -112,7 +115,10 @@ void DebuggerConnectionImpl::Handler(uword args) {
int result = TEMP_FAILURE_RETRY(
kevent(kqueue_fd_, NULL, 0, events, kMaxEvents, NULL));
if (result == -1) {
- FATAL1("kevent failed %s\n", strerror(errno));
+ const int kBufferSize = 1024;
+ char error_message[kBufferSize];
+ strerror_r(errno, error_message, kBufferSize);
+ FATAL1("kevent failed %s\n", error_message);
} else {
ASSERT(result <= kMaxEvents);
for (int i = 0; i < result; i++) {
@@ -141,7 +147,10 @@ void DebuggerConnectionImpl::SetupPollQueue() {
EV_SET(&event, wakeup_fds_[0], EVFILT_READ, EV_ADD, 0, 0, NULL);
int status = TEMP_FAILURE_RETRY(kevent(kqueue_fd_, &event, 1, NULL, 0, NULL));
if (status == -1) {
- FATAL1("Failed adding wakeup pipe fd to kqueue: %s\n", strerror(errno));
+ const int kBufferSize = 1024;
+ char error_message[kBufferSize];
+ strerror_r(errno, error_message, kBufferSize);
+ FATAL1("Failed adding wakeup pipe fd to kqueue: %s\n", error_message);
}
// Register the listening socket.
@@ -149,7 +158,10 @@ void DebuggerConnectionImpl::SetupPollQueue() {
EVFILT_READ, EV_ADD, 0, 0, NULL);
status = TEMP_FAILURE_RETRY(kevent(kqueue_fd_, &event, 1, NULL, 0, NULL));
if (status == -1) {
- FATAL1("Failed adding listener socket to kqueue: %s\n", strerror(errno));
+ const int kBufferSize = 1024;
+ char error_message[kBufferSize];
+ strerror_r(errno, error_message, kBufferSize);
+ FATAL1("Failed adding listener socket to kqueue: %s\n", error_message);
}
}
« no previous file with comments | « no previous file | runtime/bin/eventhandler_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698