Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
do not build the examples by default, only when running 'make tests'
[simgrid.git] / teshsuite / msg / host_on_off / host_on_off.c
index f714d3f..b91077b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2015. 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
@@ -17,6 +17,10 @@ static int slave(int argc, char *argv[])
 
   while (1) {
     res = MSG_task_receive(&(task), mailbox);
+    if (res == MSG_HOST_FAILURE) {
+      XBT_DEBUG("The host has been turned off, this was expected");
+      return 1;
+    }
     xbt_assert(res == MSG_OK, "MSG_task_get failed");
 
     if (!strcmp(MSG_task_get_name(task), "finalize")) {