From: Frederic Suter Date: Tue, 12 Feb 2019 14:50:54 +0000 (+0100) Subject: fix build X-Git-Tag: v3_22~354 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/eebc82491dfb1764ca8a9069e5ab662b3ccc70fd fix build --- diff --git a/src/bindings/java/jmsg_process.cpp b/src/bindings/java/jmsg_process.cpp index 2a90a8dfa8..2976e12f9b 100644 --- a/src/bindings/java/jmsg_process.cpp +++ b/src/bindings/java/jmsg_process.cpp @@ -236,9 +236,10 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_sleep(JNIEnv *env, jclass cl JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_waitFor(JNIEnv * env, jobject jprocess, jdouble jseconds) { - msg_error_t rv; + msg_error_t rv = MSG_OK; if (not simgrid::kernel::context::StopRequest::try_n_catch( - [&rv, &jseconds]() { rv = MSG_process_sleep((double)jseconds); })) { + [&jseconds]() { simgrid::s4u::this_actor::sleep_for((double)jseconds); })) { + rv = MSG_HOST_FAILURE; jxbt_throw_by_name(env, "org/simgrid/msg/ProcessKilledError", "Process killed"); } if (env->ExceptionOccurred()) diff --git a/teshsuite/msg/host_on_off_processes/host_on_off_processes.cpp b/teshsuite/msg/host_on_off_processes/host_on_off_processes.cpp index 3f500b0f4a..242697bd3f 100644 --- a/teshsuite/msg/host_on_off_processes/host_on_off_processes.cpp +++ b/teshsuite/msg/host_on_off_processes/host_on_off_processes.cpp @@ -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");