summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorBrian Havard <bjh@apache.org>2010-04-07 12:31:46 +0000
committerBrian Havard <bjh@apache.org>2010-04-07 12:31:46 +0000
commitee283217192e183faf9ae59cfaab96fd4d23a563 (patch)
tree5f0f17f7f692cb9adbb2c7df63531ef2b3bfa229 /misc
parent513c0cbe1cd0130d7cbc71756adf6778c7e8c063 (diff)
downloadapr-ee283217192e183faf9ae59cfaab96fd4d23a563.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: https://svn.apache.org/repos/asf/apr/apr/trunk@931521 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'misc')
-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;