[git commit] ash: clear sa_flags always

Denys Vlasenko vda.linux at googlemail.com
Sat Apr 16 18:05:14 UTC 2011


commit: http://git.busybox.net/busybox/commit/?id=89b3cbaa97d715ac27e9558ea73a1221925f589b
branch: http://git.busybox.net/busybox/commit/?id=refs/heads/master

Signed-off-by: Ian Wienand <ianw at vmware.com>
Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 shell/ash.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/shell/ash.c b/shell/ash.c
index 11ba977..b50e095 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;
-- 
1.7.3.4



More information about the busybox-cvs mailing list