From e31f500b4a0e990cb93efdc122551375ae228172 Mon Sep 17 00:00:00 2001 From: degomme Date: Tue, 9 Feb 2016 15:57:48 +0100 Subject: [PATCH] Sometimes (ubuntu 15.10 for us) sighup was blocked and made the following line useless. Make sure we unblock all signals. --- src/mc/simgrid_mc.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/mc/simgrid_mc.cpp b/src/mc/simgrid_mc.cpp index a923cdbcea..fb5a2b30ad 100644 --- a/src/mc/simgrid_mc.cpp +++ b/src/mc/simgrid_mc.cpp @@ -45,6 +45,15 @@ static int do_child(int socket, char** argv) #ifdef __linux__ // Make sure we do not outlive our parent: + sigset_t mask; + sigset_t orig_mask; + + sigemptyset (&mask); + if (sigprocmask(SIG_BLOCK, &mask, &orig_mask) < 0) { + std::perror ("sigprocmask"); + return SIMGRID_MC_EXIT_ERROR; + } + if (prctl(PR_SET_PDEATHSIG, SIGHUP) != 0) { std::perror("simgrid-mc"); return SIMGRID_MC_EXIT_ERROR; -- 2.20.1