Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Do not use strerror(), not thread-safe
authorGabriel Corona <gabriel.corona@loria.fr>
Fri, 13 Feb 2015 14:34:16 +0000 (15:34 +0100)
committerGabriel Corona <gabriel.corona@loria.fr>
Fri, 13 Feb 2015 14:35:02 +0000 (15:35 +0100)
src/mc/mc_client.c
src/mc/mc_global.c
src/mc/mc_protocol.c
src/mc/mc_server.cpp

index da8d8c4..62c5733 100644 (file)
@@ -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;
index bf677ae..985dba9 100644 (file)
@@ -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)
index 0034148..2815033 100644 (file)
@@ -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;
     }
   }
index 12ca0a8..39b15da 100644 (file)
@@ -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());
       }
     }