Move up waitpid error check so that errno isn't clobbered by tcsetpgrp.

This commit is contained in:
Matt Kraai 2001-05-02 21:48:17 +00:00
parent adcbc12d85
commit 80abc45182
2 changed files with 6 additions and 6 deletions

6
hush.c
View File

@ -1148,12 +1148,12 @@ static void checkjobs()
}
}
if (childpid == -1 && errno != ECHILD)
perror_msg("waitpid");
/* move the shell to the foreground */
if (tcsetpgrp(0, getpgrp()) && errno != ENOTTY)
perror_msg("tcsetpgrp");
if (childpid == -1 && errno != ECHILD)
perror_msg("waitpid");
}
/* run_pipe_real() starts all the jobs, but doesn't wait for anything

View File

@ -1148,12 +1148,12 @@ static void checkjobs()
}
}
if (childpid == -1 && errno != ECHILD)
perror_msg("waitpid");
/* move the shell to the foreground */
if (tcsetpgrp(0, getpgrp()) && errno != ENOTTY)
perror_msg("tcsetpgrp");
if (childpid == -1 && errno != ECHILD)
perror_msg("waitpid");
}
/* run_pipe_real() starts all the jobs, but doesn't wait for anything