diff options
Diffstat (limited to 'bin/sh/eval.c')
-rw-r--r-- | bin/sh/eval.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/bin/sh/eval.c b/bin/sh/eval.c index 800fc87..c5bb7d4 100644 --- a/bin/sh/eval.c +++ b/bin/sh/eval.c @@ -33,7 +33,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: eval.c,v 1.5 1996/09/01 10:19:57 peter Exp $ + * $Id: eval.c,v 1.6 1996/10/06 15:17:19 steve Exp $ */ #ifndef lint @@ -210,7 +210,6 @@ evaltree(n, flags) case NAND: evaltree(n->nbinary.ch1, EV_TESTED); if (evalskip || exitstatus != 0) { - /* don't bomb out on "set -e; false && true" */ flags |= EV_TESTED; goto out; } @@ -855,7 +854,24 @@ cmddone: parent: /* parent process gets here (if we forked) */ if (mode == 0) { /* argument to fork */ INTOFF; - exitstatus = waitforjob(jp); + if (minusc) { + struct sigaction iact, qact, oiact, oqact; + + (void)sigaction(SIGINT, (struct sigaction *)NULL, &oiact); + (void)sigaction(SIGQUIT, (struct sigaction *)NULL, &oqact); + + iact = oiact; + qact = oqact; + + qact.sa_handler = iact.sa_handler = SIG_IGN; + + (void)sigaction(SIGINT, &iact, (struct sigaction *)NULL); + (void)sigaction(SIGQUIT, &qact, (struct sigaction *)NULL); + exitstatus = waitforjob(jp); + (void)sigaction(SIGINT, &oiact, (struct sigaction *)NULL); + (void)sigaction(SIGQUIT, &oqact, (struct sigaction *)NULL); + } else + exitstatus = waitforjob(jp); INTON; } else if (mode == 2) { backcmd->fd = pip[0]; |