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
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)
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)