]> AND Public Git Repository - simgrid.git/blobdiff - src/mc/mc_safety.cpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Replace some exit() calls by return
[simgrid.git] / src / mc / mc_safety.cpp
index 65f381a14ade654141095f13eee3e8e3cca036fc..b00c31e2537cfeb4158f4913cab17d5f4463c169 100644 (file)
@@ -15,7 +15,7 @@
 #include "mc_client.h"
 #include "mc_exit.h"
 
-#include "xbt/mmalloc/mmprivate.h"
+#include "src/xbt/mmalloc/mmprivate.h"
 
 extern "C" {
 
@@ -73,7 +73,7 @@ static void MC_pre_modelcheck_safety()
 /** \brief Model-check the application using a DFS exploration
  *         with DPOR (Dynamic Partial Order Reductions)
  */
-void MC_modelcheck_safety(void)
+int MC_modelcheck_safety(void)
 {
   MC_modelcheck_safety_init();
 
@@ -126,7 +126,7 @@ void MC_modelcheck_safety(void)
 
       if(_sg_mc_termination && is_exploration_stack_state(next_state)){
           MC_show_non_termination();
-          exit(SIMGRID_EXIT_NON_TERMINATION);
+          return SIMGRID_MC_EXIT_NON_TERMINATION;
       }
 
       if ((visited_state = is_visited_state(next_state)) == NULL) {
@@ -186,7 +186,7 @@ void MC_modelcheck_safety(void)
       /* Check for deadlocks */
       if (MC_deadlock_check()) {
         MC_show_deadlock(NULL);
-        exit(SIMGRID_EXIT_DEADLOCK);
+        return SIMGRID_MC_EXIT_DEADLOCK;
       }
 
       /* Traverse the stack backwards until a state with a non empty interleave
@@ -259,7 +259,7 @@ void MC_modelcheck_safety(void)
 
   XBT_INFO("No property violation found.");
   MC_print_statistics(mc_stats);
-  exit(SIMGRID_EXIT_SUCCESS);
+  return SIMGRID_MC_EXIT_SUCCESS;
 }
 
 static void MC_modelcheck_safety_init(void)