aboutsummaryrefslogtreecommitdiff
path: root/threadproc/unix/proc.c
diff options
context:
space:
mode:
authorGreg Stein <gstein@apache.org>2001-09-20 08:59:31 +0000
committerGreg Stein <gstein@apache.org>2001-09-20 08:59:31 +0000
commitf49bd22bf61423ef1ef91f883f10fbe4366a48d0 (patch)
treeff0d0e062cdca382a2e2f2d0c46fa69fc5090d6f /threadproc/unix/proc.c
parentf92418bee86c72108b380a90e67dcbba859d8cfd (diff)
downloadapr-f49bd22bf61423ef1ef91f883f10fbe4366a48d0.tar.gz
apr-f49bd22bf61423ef1ef91f883f10fbe4366a48d0.zip
Return the exit code from apr_proc_wait(). This is a combination of a patch
from Justin and Bill, plus a few additional tweaks. Submitted by: Justin Erenkrantz <jerenkrantz@ebuilt.com>, Bill Tutt <billtut@microsoft.com> Reviewed by: Greg Stein git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62350 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'threadproc/unix/proc.c')
-rw-r--r--threadproc/unix/proc.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c
index 41f8007c9..619b18d89 100644
--- a/threadproc/unix/proc.c
+++ b/threadproc/unix/proc.c
@@ -380,23 +380,24 @@ APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc, apr_wait_t *
}
APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc,
+ apr_wait_t *exitcode,
apr_wait_how_e waithow)
{
- pid_t status;
+ pid_t pstatus;
if (waithow == APR_WAIT) {
- if ((status = waitpid(proc->pid, NULL, WUNTRACED)) > 0) {
+ if ((pstatus = waitpid(proc->pid, exitcode, WUNTRACED)) > 0) {
return APR_CHILD_DONE;
}
- else if (status == 0) {
+ else if (pstatus == 0) {
return APR_CHILD_NOTDONE;
}
return errno;
}
- if ((status = waitpid(proc->pid, NULL, WUNTRACED | WNOHANG)) > 0) {
+ if ((pstatus = waitpid(proc->pid, exitcode, WUNTRACED | WNOHANG)) > 0) {
return APR_CHILD_DONE;
}
- else if (status == 0) {
+ else if (pstatus == 0) {
return APR_CHILD_NOTDONE;
}
return errno;