Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Unused parameters argc/argv.
[simgrid.git] / teshsuite / msg / host_on_off_recv / host_on_off_recv.c
index 97363f8..5c4f339 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2018. The SimGrid Team.
+/* Copyright (c) 2010-2019. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -10,7 +10,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example")
 
 static const char* mailbox = "comm";
 
-static int master(int argc, char *argv[])
+static int master(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   msg_host_t jupiter = MSG_host_by_name("Jupiter");
 
@@ -35,13 +35,16 @@ static int master(int argc, char *argv[])
   return 0;
 }
 
-static int slave(int argc, char *argv[])
+static int slave(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   XBT_INFO("Slave receiving");
   msg_task_t task = NULL;
   msg_error_t error = MSG_task_receive(&(task), mailbox);
   if (error) {
-    XBT_ERROR("Error while receiving message");
+    if (error != MSG_HOST_FAILURE)
+      XBT_ERROR("Error while receiving message");
+    else
+      XBT_DEBUG("The host has been turned off, this was expected");
     return 1;
   }