about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/exec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Src/exec.c b/Src/exec.c
index 2ab5fb164..6d45f7452 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -2910,7 +2910,8 @@ execcmd(Estate state, int input, int output, int how, int last1)
 	    if (fdtable[i] != FDT_UNUSED)
 		close(i);
 	closem(FDT_UNUSED);
-	waitjobs();
+	if (thisjob != -1)
+	    waitjobs();
 	_exit(lastval);
     }
     fixfds(save);