Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix build
[simgrid.git] / teshsuite / msg / host_on_off_processes / host_on_off_processes.cpp
index 9d311e5..242697b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2018. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2010-2019. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -46,8 +46,9 @@ static int commTX(int /*argc*/, char** /*argv*/)
   msg_task_t task = MSG_task_create("COMM", 0, 100000000, NULL);
   MSG_task_dsend(task, mailbox, task_cleanup_handler);
   // We should wait a bit (if not the process will end before the communication, hence an exception on the other side).
-  int res = MSG_process_sleep(30);
-  if (res == MSG_HOST_FAILURE) {
+  try {
+    MSG_process_sleep(30);
+  } catch (simgrid::HostFailureException& e) {
     XBT_INFO("The host has died ... as expected.");
   }
   XBT_INFO("  TX done");