hush: fix a case when backgrounded cmd makes shell hang
authorDenys Vlasenko <vda.linux@googlemail.com>
Wed, 3 Jun 2009 12:37:30 +0000 (14:37 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Wed, 3 Jun 2009 12:37:30 +0000 (14:37 +0200)
Signed-off-by: Bayram Kurumahmut <kbayram@ubicom.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
shell/hush.c

index 1ad5fcd72f9fbec34f87effd60b2836058d80af6..de04c015a7f574f731440fb4b4a01c110e00b9b8 100644 (file)
@@ -3505,6 +3505,8 @@ static int checkjobs(struct pipe* fg_pipe)
 #endif
                                                return rcode;
                                        }
+                                       if (!fg_pipe->alive_cmds)
+                                               return rcode;
                                }
                                /* There are still running processes in the fg pipe */
                                goto wait_more; /* do waitpid again */