You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mt...@apache.org on 2011/05/23 06:34:59 UTC

svn commit: r1126309 - in /commons/sandbox/runtime/trunk/src/main/native/os/unix: arch_defs.h exec.c

Author: mturk
Date: Mon May 23 04:34:59 2011
New Revision: 1126309

URL: http://svn.apache.org/viewvc?rev=1126309&view=rev
Log:
Check for events separately

Modified:
    commons/sandbox/runtime/trunk/src/main/native/os/unix/arch_defs.h
    commons/sandbox/runtime/trunk/src/main/native/os/unix/exec.c

Modified: commons/sandbox/runtime/trunk/src/main/native/os/unix/arch_defs.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/unix/arch_defs.h?rev=1126309&r1=1126308&r2=1126309&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/unix/arch_defs.h (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/unix/arch_defs.h Mon May 23 04:34:59 2011
@@ -58,7 +58,7 @@
 
 /* Common large file replacement macros
  */
-#if defined(_BSDX)
+#if defined(_BSDX) || defined(_DARWIN)
 typedef struct stat         struct_stat_t;
 #else
 # if defined(_LARGEFILE64_SOURCE)

Modified: commons/sandbox/runtime/trunk/src/main/native/os/unix/exec.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/unix/exec.c?rev=1126309&r1=1126308&r2=1126309&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/unix/exec.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/unix/exec.c Mon May 23 04:34:59 2011
@@ -394,10 +394,12 @@ child_cleanup:
                     break;
                 }
                 for (i = 0; i < npipes; i++) {
+                    if (ps[i].revents == 0)
+                        continue;
                     /* Loop trough every pollfd and check for the
                      * returned events.
                      */
-                    if (pipes[PIPE_STDINP_WRS] == ps[i].fd && ps[i].revents) {
+                    if (pipes[PIPE_STDINP_WRS] == ps[i].fd) {
                         wr = 0;
                         if (ps[i].revents & POLLOUT) {
                             wr = r_write(pipes[PIPE_STDINP_WRS],
@@ -418,7 +420,7 @@ child_cleanup:
                                 i_close(&pipes[PIPE_STDINP_WRS]);
                         }
                     }
-                    if (pipes[PIPE_STDOUT_RDS] == ps[i].fd && ps[i].revents) {
+                    if (pipes[PIPE_STDOUT_RDS] == ps[i].fd) {
                         rd = 0;
                         if (ps[i].revents & POLLIN) {
                             rd = r_read(pipes[PIPE_STDOUT_RDS],
@@ -440,7 +442,7 @@ child_cleanup:
                                 i_close(&pipes[PIPE_STDOUT_RDS]);
                         }
                     }
-                    if (pipes[PIPE_STDERR_RDS] == ps[i].fd && ps[i].revents) {
+                    if (pipes[PIPE_STDERR_RDS] == ps[i].fd) {
                         rd = 0;
                         if (ps[i].revents & POLLIN) {
                             rd = r_read(pipes[PIPE_STDERR_RDS],