aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-07-31 04:04:47 +0000
committerEric Andersen <andersen@codepoet.org>2002-07-31 04:04:47 +0000
commit7373e485d3314e8a7085c4d1d9cea9f270445c45 (patch)
treecf30dfdaab962cedc47b755e2d59861e77fa3ae0
parent87715170ccb9c3ffda13b621385832a9103913ec (diff)
downloadbusybox-w32-7373e485d3314e8a7085c4d1d9cea9f270445c45.tar.gz
busybox-w32-7373e485d3314e8a7085c4d1d9cea9f270445c45.tar.bz2
busybox-w32-7373e485d3314e8a7085c4d1d9cea9f270445c45.zip
A couple of small bugfixes from Marshall M. Midden <m4@brecis.com>
-rw-r--r--shell/lash.c9
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)
1462 while (!job_list.fg->progs[i].pid || 1462 while (!job_list.fg->progs[i].pid ||
1463 job_list.fg->progs[i].is_stopped == 1) i++; 1463 job_list.fg->progs[i].is_stopped == 1) i++;
1464 1464
1465 if (waitpid(job_list.fg->progs[i].pid, &status, WUNTRACED)<0) 1465 if (waitpid(job_list.fg->progs[i].pid, &status, WUNTRACED)<0) {
1466 perror_msg_and_die("waitpid(%d)",job_list.fg->progs[i].pid); 1466 if (errno != ECHILD) {
1467 perror_msg_and_die("waitpid(%d)",job_list.fg->progs[i].pid);
1468 }
1469 }
1467 1470
1468 if (WIFEXITED(status) || WIFSIGNALED(status)) { 1471 if (WIFEXITED(status) || WIFSIGNALED(status)) {
1469 /* the child exited */ 1472 /* the child exited */
@@ -1500,7 +1503,7 @@ static int busy_loop(FILE * input)
1500 free(command); 1503 free(command);
1501 1504
1502 /* return controlling TTY back to parent process group before exiting */ 1505 /* return controlling TTY back to parent process group before exiting */
1503 if (tcsetpgrp(shell_terminal, parent_pgrp)) 1506 if (tcsetpgrp(shell_terminal, parent_pgrp) && errno != ENOTTY)
1504 perror_msg("tcsetpgrp"); 1507 perror_msg("tcsetpgrp");
1505 1508
1506 /* return exit status if called with "-c" */ 1509 /* return exit status if called with "-c" */