The upper while loop has already recycled child process, so the if

statement has never executed as expected, fix it.

MFC after: 3 days
This commit is contained in:
davidxu 2007-10-18 11:05:30 +00:00
parent 028be10749
commit 3d81878b1f

View File

@ -469,9 +469,7 @@ main(int argc, char *argv[])
}
break;
}
child_pgrp = getpgid(child_pid);
if (tcgetpgrp(STDERR_FILENO) == child_pgrp)
tcsetpgrp(STDERR_FILENO, getpgrp());
tcsetpgrp(STDERR_FILENO, getpgrp());
if (pid == -1)
err(1, "waitpid");
PAM_END();