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

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

No files matched your search

+3 -3
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
+3 -3
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