diff options
author | Eric Andersen <andersen@codepoet.org> | 2002-07-31 08:04:47 +0400 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2002-07-31 08:04:47 +0400 |
commit | 7373e485d3314e8a7085c4d1d9cea9f270445c45 (patch) | |
tree | cf30dfdaab962cedc47b755e2d59861e77fa3ae0 | |
parent | 87715170ccb9c3ffda13b621385832a9103913ec (diff) |
A couple of small bugfixes from Marshall M. Midden <m4@brecis.com>
-rw-r--r-- | shell/lash.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/shell/lash.c b/shell/lash.c index 16401225e..11e7dec70 100644 --- a/shell/lash.c +++ b/shell/lash.c @@ -1462,8 +1462,11 @@ static int busy_loop(FILE * input) while (!job_list.fg->progs[i].pid || job_list.fg->progs[i].is_stopped == 1) i++; - if (waitpid(job_list.fg->progs[i].pid, &status, WUNTRACED)<0) - perror_msg_and_die("waitpid(%d)",job_list.fg->progs[i].pid); + if (waitpid(job_list.fg->progs[i].pid, &status, WUNTRACED)<0) { + if (errno != ECHILD) { + perror_msg_and_die("waitpid(%d)",job_list.fg->progs[i].pid); + } + } if (WIFEXITED(status) || WIFSIGNALED(status)) { /* the child exited */ @@ -1500,7 +1503,7 @@ static int busy_loop(FILE * input) free(command); /* return controlling TTY back to parent process group before exiting */ - if (tcsetpgrp(shell_terminal, parent_pgrp)) + if (tcsetpgrp(shell_terminal, parent_pgrp) && errno != ENOTTY) perror_msg("tcsetpgrp"); /* return exit status if called with "-c" */ |