From f5b31b30aaee2ed5d32c6fa9cdae789b15c053c2 Mon Sep 17 00:00:00 2001 From: "K. Noel Belcourt" Date: Fri, 2 Jan 2015 16:25:18 -0700 Subject: [PATCH] Block signals to end of exec_cmd. --- src/engine/execunix.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/engine/execunix.c b/src/engine/execunix.c index 530f57df2..297c00377 100644 --- a/src/engine/execunix.c +++ b/src/engine/execunix.c @@ -268,11 +268,6 @@ void exec_cmd _exit( 127 ); } - /* restore previous signals */ - sigaction(SIGINT, &saveintr, NULL); - sigaction(SIGQUIT, &savequit, NULL); - sigprocmask(SIG_SETMASK, &savemask, NULL); - /******************/ /* Parent process */ /******************/ @@ -314,6 +309,11 @@ void exec_cmd /* Save input data into the selected running commands table slot. */ cmdtab[ slot ].func = func; cmdtab[ slot ].closure = closure; + + /* restore previous signals */ + sigaction(SIGINT, &saveintr, NULL); + sigaction(SIGQUIT, &savequit, NULL); + sigprocmask(SIG_SETMASK, &savemask, NULL); } #undef EXECCMD_PIPE_READ