You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by bj...@apache.org on 2010/04/07 14:31:47 UTC
svn commit: r931521 - /apr/apr/trunk/misc/unix/otherchild.c
Author: bjh
Date: Wed Apr 7 12:31:46 2010
New Revision: 931521
URL: http://svn.apache.org/viewvc?rev=931521&view=rev
Log:
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.
Modified:
apr/apr/trunk/misc/unix/otherchild.c
Modified: apr/apr/trunk/misc/unix/otherchild.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/misc/unix/otherchild.c?rev=931521&r1=931520&r2=931521&view=diff
==============================================================================
--- apr/apr/trunk/misc/unix/otherchild.c (original)
+++ apr/apr/trunk/misc/unix/otherchild.c Wed Apr 7 12:31:46 2010
@@ -139,6 +139,34 @@ APR_DECLARE(void) apr_proc_other_child_r
(*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;