apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b..@apache.org
Subject svn commit: r931521 - /apr/apr/trunk/misc/unix/otherchild.c
Date Wed, 07 Apr 2010 12:31:47 GMT
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;



Mime
View raw message