summaryrefslogtreecommitdiffhomepage
path: root/shell/ash.c
diff options
context:
space:
mode:
authorIan Wienand <ianw@vmware.com>2011-04-16 20:05:14 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2011-04-16 20:05:14 +0200
commit89b3cbaa97d715ac27e9558ea73a1221925f589b (patch)
tree6b8130ffdda076d0396d69f9b3916d08a740fa13 /shell/ash.c
parent08caf0900db680273bac419448f21fea4fe28499 (diff)
ash: clear sa_flags always
Signed-off-by: Ian Wienand <ianw@vmware.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/ash.c')
-rw-r--r--shell/ash.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 11ba9774a..b50e0952e 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -3491,13 +3491,18 @@ setsignal(int signo)
switch (new_act) {
case S_CATCH:
act.sa_handler = signal_handler;
- act.sa_flags = 0; /* matters only if !DFL and !IGN */
- sigfillset(&act.sa_mask); /* ditto */
break;
case S_IGN:
act.sa_handler = SIG_IGN;
break;
}
+
+ /* flags and mask matter only if !DFL and !IGN, but we do it
+ * for all cases for more deterministic behavior:
+ */
+ act.sa_flags = 0;
+ sigfillset(&act.sa_mask);
+
sigaction_set(signo, &act);
*t = new_act;