diff options
Diffstat (limited to 'libglusterfs/src/common-utils.c')
| -rw-r--r-- | libglusterfs/src/common-utils.c | 16 | 
1 files changed, 15 insertions, 1 deletions
diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c index 89c000bcfb6..dee6b359232 100644 --- a/libglusterfs/src/common-utils.c +++ b/libglusterfs/src/common-utils.c @@ -1534,6 +1534,7 @@ gf_system (const char *command)          char  *arg    = NULL;          char  *tmp    = NULL;          char  *argv[100] = { NULL, }; +        sigset_t set;          dupcmd = gf_strdup (command);          if (!dupcmd) @@ -1557,7 +1558,20 @@ gf_system (const char *command)                  for (idx = 3; idx < 65536; idx++) {                          close (idx);                  } -                /* Step 2: execv (); */ + +                /* Step 2: Start with an empty signal mask */ +                ret = sigemptyset (&set); +                if (ret) { +                        gf_log ("", GF_LOG_ERROR, "Failed to empty signal set"); +                        goto step3; +                } + +                ret = sigprocmask (SIG_SETMASK, &set, NULL); +                if (ret) +                        gf_log ("", GF_LOG_ERROR, "Failed to set signal mask"); + +        step3: +                /* Step 3: execv (); */                  ret = execvp (argv[0], argv);                  /* Code will not come here at all */  | 
