From 51b9ef755d5b39ff46afde90d925edc16dbc71e3 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Mon, 3 May 2021 15:51:38 +0200 Subject: [PATCH] Reduce code duplication. --- src/s4u/s4u_Exec.cpp | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/s4u/s4u_Exec.cpp b/src/s4u/s4u_Exec.cpp index 5e71c09679..7d9d44cecb 100644 --- a/src/s4u/s4u_Exec.cpp +++ b/src/s4u/s4u_Exec.cpp @@ -289,19 +289,7 @@ int sg_exec_test(sg_exec_t exec) sg_error_t sg_exec_wait(sg_exec_t exec) { - sg_error_t status = SG_OK; - - simgrid::s4u::ExecPtr s4u_exec(exec, false); - try { - s4u_exec->wait_for(-1); - } catch (const simgrid::TimeoutException&) { - status = SG_ERROR_TIMEOUT; - } catch (const simgrid::CancelException&) { - status = SG_ERROR_CANCELED; - } catch (const simgrid::HostFailureException&) { - status = SG_ERROR_HOST; - } - return status; + return sg_exec_wait_for(exec, -1.0); } sg_error_t sg_exec_wait_for(sg_exec_t exec, double timeout) @@ -323,7 +311,7 @@ sg_error_t sg_exec_wait_for(sg_exec_t exec, double timeout) int sg_exec_wait_any(sg_exec_t* execs, size_t count) { - return sg_exec_wait_any_for(execs, count, -1); + return sg_exec_wait_any_for(execs, count, -1.0); } int sg_exec_wait_any_for(sg_exec_t* execs, size_t count, double timeout) -- 2.20.1