summaryrefslogtreecommitdiff
path: root/misc/unix
diff options
context:
space:
mode:
authorbjh <bjh@13f79535-47bb-0310-9956-ffa450edef68>2010-04-07 12:31:46 +0000
committerbjh <bjh@13f79535-47bb-0310-9956-ffa450edef68>2010-04-07 12:31:46 +0000
commitb77ba8721bae2b41d7698443ce64279f028a4fb4 (patch)
tree5f0f17f7f692cb9adbb2c7df63531ef2b3bfa229 /misc/unix
parent2797b228335a30e2ea93cba16083660105d03078 (diff)
downloadlibapr-b77ba8721bae2b41d7698443ce64279f028a4fb4.tar.gz
OS/2: Add OS/2 specific handling in apr_proc_other_child_refresh().
Now passes testoc. Was resulting in APR_OC_REASON_LOST on child death. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@931521 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'misc/unix')
-rw-r--r--misc/unix/otherchild.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/misc/unix/otherchild.c b/misc/unix/otherchild.c
index ea43edfb7..a2fef19ac 100644
--- a/misc/unix/otherchild.c
+++ b/misc/unix/otherchild.c
@@ -139,6 +139,34 @@ APR_DECLARE(void) apr_proc_other_child_refresh(apr_other_child_rec_t *ocr,
(*ocr->maintenance) (APR_OC_REASON_DEATH, ocr->data, status);
}
+#elif defined(OS2)
+ int rc;
+ int status;
+ RESULTCODES proc_rc;
+ PID ended_pid;
+
+ if (ocr->proc == NULL) {
+ return;
+ }
+
+ rc = DosWaitChild(DCWA_PROCESS, DCWW_NOWAIT, &proc_rc, &ended_pid, ocr->proc->pid);
+
+ switch (rc) {
+ case 0:
+ ocr->proc = NULL;
+ status = (proc_rc.codeResult << 8) | proc_rc.codeTerminate;
+ (*ocr->maintenance) (APR_OC_REASON_DEATH, ocr->data, status);
+ break;
+
+ case ERROR_CHILD_NOT_COMPLETE:
+ (*ocr->maintenance) (reason, ocr->data, -1);
+ break;
+
+ default:
+ ocr->proc = NULL;
+ (*ocr->maintenance) (APR_OC_REASON_LOST, ocr->data, -1);
+ break;
+ }
#else /* ndef Win32 */
pid_t waitret;
int status;