From 912192732ebe88be5593c480245730dea382b9dd Mon Sep 17 00:00:00 2001 From: des Date: Sat, 8 Feb 2003 16:11:20 +0000 Subject: [PATCH] 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. --- usr.bin/login/login.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.bin/login/login.c b/usr.bin/login/login.c index 9ded0c057381..5eb60fbceeee 100644 --- a/usr.bin/login/login.c +++ b/usr.bin/login/login.c @@ -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); }