Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Reduce code duplication.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 21 Jun 2021 14:57:20 +0000 (16:57 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 22 Jun 2021 15:20:07 +0000 (17:20 +0200)
src/s4u/s4u_Comm.cpp

index b0c22d8..079626e 100644 (file)
@@ -298,19 +298,7 @@ int sg_comm_test(sg_comm_t comm)
 
 sg_error_t sg_comm_wait(sg_comm_t comm)
 {
-  sg_error_t status = SG_OK;
-
-  simgrid::s4u::CommPtr s4u_comm(comm, false);
-  try {
-    s4u_comm->wait_for(-1);
-  } catch (const simgrid::TimeoutException&) {
-    status = SG_ERROR_TIMEOUT;
-  } catch (const simgrid::CancelException&) {
-    status = SG_ERROR_CANCELED;
-  } catch (const simgrid::NetworkFailureException&) {
-    status = SG_ERROR_NETWORK;
-  }
-  return status;
+  return sg_comm_wait_for(comm, -1);
 }
 
 sg_error_t sg_comm_wait_for(sg_comm_t comm, double timeout)