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 2009/11/23 09:35:04 UTC

svn commit: r883276 - /commons/sandbox/runtime/trunk/src/main/native/os/unix/pipe.c

Author: mturk
Date: Mon Nov 23 08:35:04 2009
New Revision: 883276

URL: http://svn.apache.org/viewvc?rev=883276&view=rev
Log:
Check for particular pipe modes

Modified:
    commons/sandbox/runtime/trunk/src/main/native/os/unix/pipe.c

Modified: commons/sandbox/runtime/trunk/src/main/native/os/unix/pipe.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/unix/pipe.c?rev=883276&r1=883275&r2=883276&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/unix/pipe.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/unix/pipe.c Mon Nov 23 08:35:04 2009
@@ -162,10 +162,13 @@
 {
     int rc =  0;
     int fo;
+    int ff = flags & 0xFF;
     jobject od;
     acr_file_t *fp = NULL;
 
-    if ((flags & 0xFF) == ACR_PIPE_FULL_NONBLOCK) {
+    if (ff == ACR_PIPE_FULL_NONBLOCK ||
+       (ff == ACR_PIPE_CHILD_BLOCK  && (flags & ACR_PIPE_IN)) ||
+       (ff == ACR_PIPE_PARENT_BLOCK && (flags & ACR_PIPE_OUT))) {
         if ((rc = acr_nonblock(fd, 1)))
             goto finally;
     }
@@ -178,7 +181,9 @@
     fp->name   = NULL;
     fp->flags  = flags;
     fp->type   = ACR_FT_PIPE;
-    if ((flags & 0xFF) == ACR_PIPE_FULL_NONBLOCK) {
+    if (ff == ACR_PIPE_FULL_NONBLOCK ||
+       (ff == ACR_PIPE_CHILD_BLOCK  && (flags & ACR_PIPE_IN)) ||
+       (ff == ACR_PIPE_PARENT_BLOCK && (flags & ACR_PIPE_OUT))) {
         fp->blocking = BLK_OFF;
         fp->timeout  = 0;
     }