From 92afe9670ecc5246040dad7a9d6b805f9c8f84cb Mon Sep 17 00:00:00 2001 From: Gabriel Corona Date: Fri, 10 Apr 2015 12:15:27 +0200 Subject: [PATCH] [mc] Kill the MCed process if/when the MCer dies --- src/mc/simgrid_mc.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mc/simgrid_mc.cpp b/src/mc/simgrid_mc.cpp index 0c8899bbee..71d0388828 100644 --- a/src/mc/simgrid_mc.cpp +++ b/src/mc/simgrid_mc.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include @@ -38,6 +39,10 @@ static const bool trace = true; static int do_child(int socket, char** argv) { XBT_DEBUG("Inside the child process PID=%i", (int) getpid()); + if (prctl(PR_SET_PDEATHSIG, SIGHUP) != 0) { + std::perror("simgrid-mc"); + return MC_SERVER_ERROR; + } int res; // Remove CLOEXEC in order to pass the socket to the exec-ed program: -- 2.20.1