loop until waitpid returns pid_child or error

closes #104

Signed-off-by: ed neville <ed@s5h.net>
This commit is contained in:
ed neville 2020-09-20 23:02:58 +01:00
parent 9a10373ddb
commit 01a8df79b3

View File

@ -354,7 +354,9 @@ static void prepare_pam_close_session (void)
pid_t pid; pid_t pid;
stop = true; 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 /* When interrupted by signal, the signal will be
* forwarded to the child, and termination will be * forwarded to the child, and termination will be