From 31f6b3fb07ec0d5816c2dabbc314009c3126b58b Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Thu, 2 Mar 2006 22:05:21 +0000 Subject: 22317: exit status from code backgrounded in function 22277, 22281, tweaks: standardize behaviour of wait builtin with trapped signals --- Src/exec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Src/exec.c') diff --git a/Src/exec.c b/Src/exec.c index 58fc476bc..6c68c5c7d 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -3037,7 +3037,7 @@ getoutput(char *cmd, int qt) zclose(pipes[1]); retval = readoutput(pipes[0], qt); fdtable[pipes[0]] = FDT_UNUSED; - waitforpid(pid); /* unblocks */ + waitforpid(pid, 0); /* unblocks */ lastval = cmdoutval; return retval; } @@ -3190,7 +3190,7 @@ getoutputfile(char *cmd) close(fd); os = jobtab[thisjob].stat; - waitforpid(pid); + waitforpid(pid, 0); cmdoutval = 0; jobtab[thisjob].stat = os; return nam; @@ -3852,7 +3852,7 @@ doshfunc(char *name, Eprog prog, LinkList doshargs, int flags, int noreturnval) popheap(); if (exit_pending) { - if (locallevel) { + if (locallevel > forklevel) { /* Still functions to return: force them to do so. */ retflag = 1; breaks = loops; -- cgit 1.4.1