Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Sometimes (ubuntu 15.10 for us) sighup was blocked and made the following line useless.
authordegomme <augustin.degomme@unibas.ch>
Tue, 9 Feb 2016 14:57:48 +0000 (15:57 +0100)
committerdegomme <augustin.degomme@unibas.ch>
Tue, 9 Feb 2016 16:03:09 +0000 (17:03 +0100)
Make sure we unblock all signals.

src/mc/simgrid_mc.cpp

index a923cdb..fb5a2b3 100644 (file)
@@ -45,6 +45,15 @@ static int do_child(int socket, char** argv)
 
 #ifdef __linux__
   // Make sure we do not outlive our parent:
 
 #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;
   if (prctl(PR_SET_PDEATHSIG, SIGHUP) != 0) {
     std::perror("simgrid-mc");
     return SIMGRID_MC_EXIT_ERROR;