Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Use _exit() in fork()-ed process
[simgrid.git] / src / mc / simgrid_mc.cpp
index 8b7962b..0c3a6f4 100644 (file)
@@ -12,6 +12,7 @@
 
 #include <utility>
 
+#include <fcntl.h>
 #include <signal.h>
 #include <poll.h>
 
@@ -57,7 +58,7 @@ pid_t do_fork(F f)
   // Child-process:
   try {
     f();
-    std::exit(EXIT_SUCCESS);
+    _exit(EXIT_SUCCESS);
   }
   catch(...) {
     // The callback should catch exceptions:
@@ -124,7 +125,7 @@ std::pair<pid_t, int> create_model_checked(char** argv)
     close(sockets[1]);
     int res = exec_model_checked(sockets[0], argv);
     XBT_DEBUG("Error in the child process creation");
-    exit(res);
+    _exit(res);
   });
 
   // Parent (model-checker):
@@ -173,9 +174,9 @@ int main(int argc, char** argv)
     if (_sg_mc_comms_determinism || _sg_mc_send_determinism)
       res = MC_modelcheck_comm_determinism();
     else if (!_sg_mc_property_file || _sg_mc_property_file[0] == '\0')
-      res = MC_modelcheck_safety();
+      res = simgrid::mc::modelcheck_safety();
     else
-      res = MC_modelcheck_liveness();
+      res = simgrid::mc::modelcheck_liveness();
     mc_model_checker->shutdown();
     return res;
   }