From 6a98f95373d60d48001299797f52b1f19c7ffecd Mon Sep 17 00:00:00 2001
From: Denys Vlasenko <vda.linux@googlemail.com>
Date: Wed, 3 Jun 2009 14:37:30 +0200
Subject: hush: fix a case when backgrounded cmd makes shell hang

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 | 2 ++
 1 file changed, 2 insertions(+)

(limited to 'shell')

diff --git a/shell/hush.c b/shell/hush.c
index 386307720..835159066 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -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 */
-- 
cgit v1.2.3-55-g6feb