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)
committerMike Frysinger <vapier@gentoo.org>
Wed, 22 Jul 2009 09:19:15 +0000 (05:19 -0400)
Signed-off-by: Bayram Kurumahmut <kbayram@ubicom.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
shell/hush.c

index 3863077207d2af021a5047554792deb8ac13bde2..8351590661b56c8c56431bdb7a5f5920994b2801 100644 (file)
@@ -3398,6 +3398,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 */