summaryrefslogtreecommitdiff
path: root/threadproc
diff options
context:
space:
mode:
authorthommay <thommay@13f79535-47bb-0310-9956-ffa450edef68>2003-05-08 08:51:02 +0000
committerthommay <thommay@13f79535-47bb-0310-9956-ffa450edef68>2003-05-08 08:51:02 +0000
commit18ac4f07ca104c7d5615697faf72e92e7fec9b87 (patch)
tree093411bc7b95a8acbd7de0ea0ef46e8c59d76357 /threadproc
parent1da5393537da8d9b00f89d3bddadfa96d6f928cc (diff)
downloadlibapr-18ac4f07ca104c7d5615697faf72e92e7fec9b87.tar.gz
(apr_proc_wait): Handle interrupted waitpid(2) calls by calling
it repeatedly until it succeeds or fails with errno other than EINTR. This hides this UNIX-specific behavior from APR clients. Submitted by: Eric Gillespie <epg@pretzelnet.org> Reviewed by: Thom May git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64501 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'threadproc')
-rw-r--r--threadproc/unix/proc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c
index 2fbcb2908..ecfeddea3 100644
--- a/threadproc/unix/proc.c
+++ b/threadproc/unix/proc.c
@@ -556,7 +556,11 @@ APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc,
waitpid_options |= WNOHANG;
}
- if ((pstatus = waitpid(proc->pid, &exit_int, waitpid_options)) > 0) {
+ do {
+ pstatus = waitpid(proc->pid, &exit_int, waitpid_options);
+ } while (pstatus < 0 && errno == EINTR);
+
+ if (pstatus > 0) {
proc->pid = pstatus;
if (WIFEXITED(exit_int)) {