aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-07-05 08:33:24 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-07-05 08:33:24 +0100
commit030336c989366ebe576a63ecbcab6824e5e8e9ae (patch)
tree9de5d3bbe23e2f37ae3dee5009c911c2b9a16405
parente054f7d4601670fcc31d8c5dbb282f7112b34ad0 (diff)
downloadpaludis-030336c989366ebe576a63ecbcab6824e5e8e9ae.tar.gz
paludis-030336c989366ebe576a63ecbcab6824e5e8e9ae.tar.xz
Always sigemtyset sigaction.sa_mask
Fixes: ticket:911
-rw-r--r--paludis/util/system.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/paludis/util/system.cc b/paludis/util/system.cc
index 706af79..cad7a43 100644
--- a/paludis/util/system.cc
+++ b/paludis/util/system.cc
@@ -589,6 +589,7 @@ paludis::run_command(const Command & cmd)
/* clear any SIGINT or SIGTERM handlers we inherit, and unblock signals */
struct sigaction act;
+ sigemptyset(&act.sa_mask);
act.sa_handler = SIG_DFL;
act.sa_flags = 0;
sigaction(SIGINT, &act, 0);
@@ -717,9 +718,9 @@ paludis::run_command(const Command & cmd)
/* On SIGINT or SIGTERM, just output a notice. */
struct sigaction act, old_act;
+ sigemptyset(&act.sa_mask);
act.sa_handler = &wait_handler;
act.sa_flags = SA_RESTART;
- sigemptyset(&act.sa_mask);
sigaddset(&act.sa_mask, SIGINT);
sigaddset(&act.sa_mask, SIGTERM);
@@ -1087,6 +1088,7 @@ paludis::become_command(const Command & cmd)
/* Ignore CLD. POSIX may or may not say that if we do this, our child will
* not become a zombie. */
struct sigaction act;
+ sigemptyset(&act.sa_mask);
act.sa_handler = SIG_IGN;
act.sa_flags = 0;
sigaction(SIGCLD, &act, 0);
@@ -1133,6 +1135,7 @@ paludis::become_command(const Command & cmd)
/* clear any SIGINT or SIGTERM handlers we inherit, and unblock signals */
struct sigaction act;
+ sigemptyset(&act.sa_mask);
act.sa_handler = SIG_DFL;
act.sa_flags = 0;
sigaction(SIGINT, &act, 0);