From 7bc4a90371437faf0fcd3268a8221edfcf4cc7ef Mon Sep 17 00:00:00 2001 From: Gabriel Corona Date: Fri, 13 Feb 2015 15:34:16 +0100 Subject: [PATCH] [mc] Do not use strerror(), not thread-safe --- src/mc/mc_client.c | 3 +-- src/mc/mc_global.c | 2 +- src/mc/mc_protocol.c | 4 ++-- src/mc/mc_server.cpp | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/mc/mc_client.c b/src/mc/mc_client.c index da8d8c41a4..62c57338bd 100644 --- a/src/mc/mc_client.c +++ b/src/mc/mc_client.c @@ -77,8 +77,7 @@ void MC_client_handle_messages(void) char message_buffer[MC_MESSAGE_LENGTH]; size_t s; if ((s = recv(mc_client->fd, &message_buffer, sizeof(message_buffer), 0)) == -1) - xbt_die("Could not receive commands from the model-checker: %s", - strerror(errno)); + xbt_die("Could not receive commands from the model-checker"); XBT_DEBUG("Receive message from model-checker"); s_mc_message_t message; diff --git a/src/mc/mc_global.c b/src/mc/mc_global.c index bf677ae9ca..985dba9e2e 100644 --- a/src/mc/mc_global.c +++ b/src/mc/mc_global.c @@ -318,7 +318,7 @@ int MC_deadlock_check() int res; if ((res = MC_protocol_send_simple_message(mc_model_checker->process.socket, MC_MESSAGE_DEADLOCK_CHECK))) - xbt_die("Could not check deadlock state: %s",strerror(res)); + xbt_die("Could not check deadlock state"); s_mc_int_message_t message; ssize_t s = MC_receive_message(mc_model_checker->process.socket, &message, sizeof(message)); if (s == -1) diff --git a/src/mc/mc_protocol.c b/src/mc/mc_protocol.c index 0034148403..28150330fd 100644 --- a/src/mc/mc_protocol.c +++ b/src/mc/mc_protocol.c @@ -39,7 +39,7 @@ int MC_protocol_hello(int socket) { int e; if ((e = MC_protocol_send_simple_message(socket, MC_MESSAGE_HELLO)) != 0) { - XBT_ERROR("Could not send HELLO message: %s", strerror(e)); + XBT_ERROR("Could not send HELLO message"); return 1; } @@ -51,7 +51,7 @@ int MC_protocol_hello(int socket) if (errno == EINTR) continue; else { - XBT_ERROR("Could not receive HELLO message: %s", strerror(errno)); + XBT_ERROR("Could not receive HELLO message"); return 2; } } diff --git a/src/mc/mc_server.cpp b/src/mc/mc_server.cpp index 12ca0a89a3..39b15da755 100644 --- a/src/mc/mc_server.cpp +++ b/src/mc/mc_server.cpp @@ -302,7 +302,7 @@ void s_mc_server::handle_waitpid() else break; } else { - XBT_ERROR("Could not wait for pid: %s", strerror(errno)); + XBT_ERROR("Could not wait for pid"); throw std::system_error(errno, std::system_category()); } } -- 2.30.2