summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--shell/hush.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/shell/hush.c b/shell/hush.c
index 553c8e6..af5c260 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -9967,7 +9967,7 @@ static int FAST_FUNC builtin_wait(char **argv)
/* No */
ret = 127;
if (errno == ECHILD) {
- if (G.last_bg_pid > 0 && pid == G.last_bg_pid) {
+ if (pid == G.last_bg_pid) {
/* "wait $!" but last bg task has already exited. Try:
* (sleep 1; exit 3) & sleep 2; echo $?; wait $!; echo $?
* In bash it prints exitcode 0, then 3.