From: Ben Gras Date: Tue, 28 Mar 2006 11:28:16 +0000 (+0000) Subject: Don't open pipes readwrite as it leads to confusion. X-Git-Tag: v3.1.2a~115 X-Git-Url: http://zhaoyanbai.com/repos/CHANGES?a=commitdiff_plain;h=2d5058685df4ef2245e246f1d6ee124ad540272d;p=minix.git Don't open pipes readwrite as it leads to confusion. --- diff --git a/servers/fs/open.c b/servers/fs/open.c index 31f6eaf30..a4f2cdbc4 100644 --- a/servers/fs/open.c +++ b/servers/fs/open.c @@ -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);