aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2011-05-12 10:59:18 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2011-05-12 10:59:18 +0200
commitebc1ee2e2a243a0ff3de6d2b70406ba75b771fa0 (patch)
tree5c13137248122946df4063235436a389c1d46029 /shell
parent0c40a731e3fcebe49f5b1636011b20cb316aeb0d (diff)
downloadbusybox-w32-ebc1ee2e2a243a0ff3de6d2b70406ba75b771fa0.tar.gz
busybox-w32-ebc1ee2e2a243a0ff3de6d2b70406ba75b771fa0.tar.bz2
busybox-w32-ebc1ee2e2a243a0ff3de6d2b70406ba75b771fa0.zip
hush: remove one sigprocmask from exit path
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell')
-rw-r--r--shell/hush.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/shell/hush.c b/shell/hush.c
index 89a13feb8..bb95d6318 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -1456,13 +1456,15 @@ static void record_pending_signo(int sig)
1456static void sigexit(int sig) NORETURN; 1456static void sigexit(int sig) NORETURN;
1457static void sigexit(int sig) 1457static void sigexit(int sig)
1458{ 1458{
1459 /* Disable all signals: job control, SIGPIPE, etc. */
1460 sigprocmask_allsigs(SIG_BLOCK);
1461
1462 /* Careful: we can end up here after [v]fork. Do not restore 1459 /* Careful: we can end up here after [v]fork. Do not restore
1463 * tty pgrp then, only top-level shell process does that */ 1460 * tty pgrp then, only top-level shell process does that */
1464 if (G_saved_tty_pgrp && getpid() == G.root_pid) 1461 if (G_saved_tty_pgrp && getpid() == G.root_pid) {
1462 /* Disable all signals: job control, SIGPIPE, etc.
1463 * Mostly paranoid measure, to prevent infinite SIGTTOU.
1464 */
1465 sigprocmask_allsigs(SIG_BLOCK);
1465 tcsetpgrp(G_interactive_fd, G_saved_tty_pgrp); 1466 tcsetpgrp(G_interactive_fd, G_saved_tty_pgrp);
1467 }
1466 1468
1467 /* Not a signal, just exit */ 1469 /* Not a signal, just exit */
1468 if (sig <= 0) 1470 if (sig <= 0)