Larry's variant on Evin Robertson's fix to what I messed up
authorEric Andersen <andersen@codepoet.org>
Fri, 4 May 2001 22:13:37 +0000 (22:13 -0000)
committerEric Andersen <andersen@codepoet.org>
Fri, 4 May 2001 22:13:37 +0000 (22:13 -0000)
trying to make job control work.  This fix makes it so that
hush doesn't error out when init hasn't set up job control,
as in when init=/bin/sh

hush.c
shell/hush.c

diff --git a/hush.c b/hush.c
index 976fa3805d1c3c80be15a1b7846b10800ae0f6aa..b8e4a55c26bf8914114306ccce6ffd2a1b51f112 100644 (file)
--- a/hush.c
+++ b/hush.c
@@ -1185,7 +1185,7 @@ static int run_pipe_real(struct pipe *pi)
        pi->pgrp = 0;
 
        /* Check if we are supposed to run in the foreground */
-       if (pi->followup!=PIPE_BG) {
+       if (interactive && pi->followup!=PIPE_BG) {
                if ((pi->pgrp = tcgetpgrp(ctty = 2)) < 0
                                && (pi->pgrp = tcgetpgrp(ctty = 0)) < 0
                                && (pi->pgrp = tcgetpgrp(ctty = 1)) < 0)
index 976fa3805d1c3c80be15a1b7846b10800ae0f6aa..b8e4a55c26bf8914114306ccce6ffd2a1b51f112 100644 (file)
@@ -1185,7 +1185,7 @@ static int run_pipe_real(struct pipe *pi)
        pi->pgrp = 0;
 
        /* Check if we are supposed to run in the foreground */
-       if (pi->followup!=PIPE_BG) {
+       if (interactive && pi->followup!=PIPE_BG) {
                if ((pi->pgrp = tcgetpgrp(ctty = 2)) < 0
                                && (pi->pgrp = tcgetpgrp(ctty = 0)) < 0
                                && (pi->pgrp = tcgetpgrp(ctty = 1)) < 0)