]> Zhao Yanbai Git Server - minix.git/commitdiff
Don't open pipes readwrite as it leads to confusion.
authorBen Gras <ben@minix3.org>
Tue, 28 Mar 2006 11:28:16 +0000 (11:28 +0000)
committerBen Gras <ben@minix3.org>
Tue, 28 Mar 2006 11:28:16 +0000 (11:28 +0000)
servers/fs/open.c

index 31f6eaf30e3e75d9bfc100e86667407a6a4581ba..a4f2cdbc4c48d7f2f4e08ec63605dbacafb2ef48 100644 (file)
@@ -287,6 +287,12 @@ PRIVATE int pipe_open(register struct inode *rip, register mode_t bits,
  */
 
   rip->i_pipe = I_PIPE; 
+
+  if((bits & (R_BIT|W_BIT)) == (R_BIT|W_BIT)) {
+       printf("pipe opened RW.\n");
+       return ENXIO;
+  }
+
   if (find_filp(rip, bits & W_BIT ? R_BIT : W_BIT) == NIL_FILP) { 
        if (oflags & O_NONBLOCK) {
                if (bits & W_BIT) return(ENXIO);