diff options
-rw-r--r-- | auth-pam.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/auth-pam.c b/auth-pam.c index 1f13c181c..348fe370a 100644 --- a/auth-pam.c +++ b/auth-pam.c | |||
@@ -154,9 +154,12 @@ sshpam_sigchld_handler(int sig) | |||
154 | <= 0) { | 154 | <= 0) { |
155 | /* PAM thread has not exitted, privsep slave must have */ | 155 | /* PAM thread has not exitted, privsep slave must have */ |
156 | kill(cleanup_ctxt->pam_thread, SIGTERM); | 156 | kill(cleanup_ctxt->pam_thread, SIGTERM); |
157 | if (waitpid(cleanup_ctxt->pam_thread, &sshpam_thread_status, 0) | 157 | while (waitpid(cleanup_ctxt->pam_thread, |
158 | <= 0) | 158 | &sshpam_thread_status, 0) == -1) { |
159 | return; /* could not wait */ | 159 | if (errno == EINTR) |
160 | continue; | ||
161 | return; | ||
162 | } | ||
160 | } | 163 | } |
161 | if (WIFSIGNALED(sshpam_thread_status) && | 164 | if (WIFSIGNALED(sshpam_thread_status) && |
162 | WTERMSIG(sshpam_thread_status) == SIGTERM) | 165 | WTERMSIG(sshpam_thread_status) == SIGTERM) |
@@ -217,7 +220,11 @@ pthread_join(sp_pthread_t thread, void **value) | |||
217 | if (sshpam_thread_status != -1) | 220 | if (sshpam_thread_status != -1) |
218 | return (sshpam_thread_status); | 221 | return (sshpam_thread_status); |
219 | signal(SIGCHLD, sshpam_oldsig); | 222 | signal(SIGCHLD, sshpam_oldsig); |
220 | waitpid(thread, &status, 0); | 223 | while (waitpid(thread, &status, 0) == -1) { |
224 | if (errno == EINTR) | ||
225 | continue; | ||
226 | fatal("%s: waitpid: %s", __func__, strerror(errno)); | ||
227 | } | ||
221 | return (status); | 228 | return (status); |
222 | } | 229 | } |
223 | #endif | 230 | #endif |