aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2020-02-20 13:00:04 +0000
committerRon Yorston <rmy@pobox.com>2020-02-20 13:05:05 +0000
commitff83afd9da03a9dbc16a403c542bb60008da4815 (patch)
treeae6bf71326f648d520035b8776d7c474a13039ff /shell
parenteee533be9b75c2f5f92f37d7516e12cf9e4992be (diff)
downloadbusybox-w32-ff83afd9da03a9dbc16a403c542bb60008da4815.tar.gz
busybox-w32-ff83afd9da03a9dbc16a403c542bb60008da4815.tar.bz2
busybox-w32-ff83afd9da03a9dbc16a403c542bb60008da4815.zip
ash: fixes to make the last merge work
In dowait() force waitone() to be called at least once. This is less efficient but is required since on Microsoft Windows got_sigchld will never be set. Propagate return status of nofork applets. This fix has also been accepted upstream.
Diffstat (limited to 'shell')
-rw-r--r--shell/ash.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 39b14d5a6..96dab9a81 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -4961,7 +4961,11 @@ waitone(int block, struct job *job)
4961static int 4961static int
4962dowait(int block, struct job *jp) 4962dowait(int block, struct job *jp)
4963{ 4963{
4964#if !ENABLE_PLATFORM_MINGW32
4964 int pid = block == DOWAIT_NONBLOCK ? got_sigchld : 1; 4965 int pid = block == DOWAIT_NONBLOCK ? got_sigchld : 1;
4966#else
4967 int pid = 1;
4968#endif
4965 4969
4966 while (jp ? jp->state == JOBRUNNING : pid > 0) { 4970 while (jp ? jp->state == JOBRUNNING : pid > 0) {
4967 if (!jp) 4971 if (!jp)
@@ -11029,7 +11033,7 @@ evalcommand(union node *cmd, int flags)
11029 * and/or wait for user input ineligible for NOFORK: 11033 * and/or wait for user input ineligible for NOFORK:
11030 * for example, "yes" or "rm" (rm -i waits for input). 11034 * for example, "yes" or "rm" (rm -i waits for input).
11031 */ 11035 */
11032 status = run_nofork_applet(applet_no, argv); 11036 exitstatus = run_nofork_applet(applet_no, argv);
11033 environ = sv_environ; 11037 environ = sv_environ;
11034 /* 11038 /*
11035 * Try enabling NOFORK for "yes" applet. 11039 * Try enabling NOFORK for "yes" applet.