From: ed neville Date: Sun, 20 Sep 2020 22:02:58 +0000 (+0100) Subject: loop until waitpid returns pid_child or error X-Git-Tag: v4.9~56^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F278%2Fhead;p=thirdparty%2Fshadow.git loop until waitpid returns pid_child or error closes #104 Signed-off-by: ed neville --- diff --git a/src/su.c b/src/su.c index fc0e826f7..cea3f1552 100644 --- a/src/su.c +++ b/src/su.c @@ -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