Use waitpid() instead of wait() since we know the pid of the process we

are waiting for, and we don't want to reap the wrong process.
This commit is contained in:
des 2003-02-08 16:11:20 +00:00
parent af6bbda282
commit 912192732e

View File

@ -506,8 +506,9 @@ main(int argc, char *argv[])
* Parent: wait for child to finish, then clean up
* session.
*/
int status;
setproctitle("-%s [pam]", getprogname());
wait(NULL);
waitpid(pid, &status, 0);
bail(NO_SLEEP_EXIT, 0);
}