Merge pull request #278 from edneville/104_su_waitpid

loop until waitpid returns pid_child or error
This commit is contained in:
Serge Hallyn 2020-09-24 21:58:35 -05:00 committed by GitHub
commit 6bd08f7d18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -354,7 +354,9 @@ static void prepare_pam_close_session (void)
pid_t pid;
stop = true;
pid = waitpid (-1, &status, WUNTRACED);
do {
pid = waitpid (-1, &status, WUNTRACED);
} while (pid != -1 && pid != pid_child);
/* When interrupted by signal, the signal will be
* forwarded to the child, and termination will be