From ff83afd9da03a9dbc16a403c542bb60008da4815 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Thu, 20 Feb 2020 13:00:04 +0000 Subject: 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. --- shell/ash.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) static int dowait(int block, struct job *jp) { +#if !ENABLE_PLATFORM_MINGW32 int pid = block == DOWAIT_NONBLOCK ? got_sigchld : 1; +#else + int pid = 1; +#endif while (jp ? jp->state == JOBRUNNING : pid > 0) { if (!jp) @@ -11029,7 +11033,7 @@ evalcommand(union node *cmd, int flags) * and/or wait for user input ineligible for NOFORK: * for example, "yes" or "rm" (rm -i waits for input). */ - status = run_nofork_applet(applet_no, argv); + exitstatus = run_nofork_applet(applet_no, argv); environ = sv_environ; /* * Try enabling NOFORK for "yes" applet. -- cgit v1.2.3-55-g6feb