Some script files were not returning to the shell before this fix.

cmd1
cmd2
cmd3 & ----> this line was causing problems.
cmd4

A comment extracted from hush:

"....non-interactive bash does not continue if all processes in fg pipe are 
stopped...."

It seems that we must return if there is no stopped or alive process in 
non-interactive shell. If we don't, code is stopping on waitpid() but there is 
no process to wait.

Regards,
Bayram
diff --git a/shell/hush.c b/shell/hush.c
index e3f7b6e..dee92cb 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -3431,6 +3431,8 @@ static int checkjobs(struct pipe* fg_pipe)
 #endif
 						return rcode;
 					}
+					if (!fg_pipe->stopped_cmds)
+						return rcode;	/* no alive or stopped process */
 				}
 				/* There are still running processes in the fg pipe */
 				goto wait_more; /* do waitpid again */
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to