From: Gabriel Corona Date: Thu, 7 May 2015 08:11:12 +0000 (+0200) Subject: [mc] Only use prctl(PR_SET_PDEATHSIG) on Linux X-Git-Tag: v3_12~732^2~8 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/92e3bfcf13304cf11bc64722974dfdca8b2ae6d4?hp=21a114e269166ac0792cfa5fb78327a9064907dd [mc] Only use prctl(PR_SET_PDEATHSIG) on Linux --- diff --git a/src/mc/simgrid_mc.cpp b/src/mc/simgrid_mc.cpp index 6ffb402179..1d517f1f81 100644 --- a/src/mc/simgrid_mc.cpp +++ b/src/mc/simgrid_mc.cpp @@ -18,7 +18,10 @@ #include #include #include + +#ifdef __linux__ #include +#endif #include @@ -38,10 +41,15 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_main, mc, "Entry point for simgrid-mc"); static int do_child(int socket, char** argv) { XBT_DEBUG("Inside the child process PID=%i", (int) getpid()); + +#ifdef __linux__ + // Make sure we do not outlive our parent: if (prctl(PR_SET_PDEATHSIG, SIGHUP) != 0) { std::perror("simgrid-mc"); return MC_SERVER_ERROR; } +#endif + int res; // Remove CLOEXEC in order to pass the socket to the exec-ed program: