diff options
author | Niels Provos <provos@cvs.openbsd.org> | 2000-11-15 23:21:43 +0000 |
---|---|---|
committer | Niels Provos <provos@cvs.openbsd.org> | 2000-11-15 23:21:43 +0000 |
commit | 627cca26e92523fcba99bb18ff7fdb6cf1374358 (patch) | |
tree | dbaa539d71a0ced9fe798c7de2fdc5dc6835910e /sys/miscfs | |
parent | 174b1e1d2b17ec13cd505d30b9170551ba7a407d (diff) |
deal with stupid legacy applications that open a fifo O_RDWR. okay millert@
Diffstat (limited to 'sys/miscfs')
-rw-r--r-- | sys/miscfs/fifofs/fifo_vnops.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/sys/miscfs/fifofs/fifo_vnops.c b/sys/miscfs/fifofs/fifo_vnops.c index 412f0bd6dc2..4bb6da560ab 100644 --- a/sys/miscfs/fifofs/fifo_vnops.c +++ b/sys/miscfs/fifofs/fifo_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fifo_vnops.c,v 1.7 1997/11/06 05:58:34 csapuntz Exp $ */ +/* $OpenBSD: fifo_vnops.c,v 1.8 2000/11/15 23:21:42 provos Exp $ */ /* $NetBSD: fifo_vnops.c,v 1.18 1996/03/16 23:52:42 christos Exp $ */ /* @@ -186,8 +186,7 @@ fifo_open(v) if (fip->fi_writers > 0) wakeup((caddr_t)&fip->fi_writers); } - } - if (ap->a_mode & FWRITE) { + } else if (ap->a_mode & FWRITE) { if (fip->fi_writers++ == 0) { fip->fi_readsock->so_state &= ~SS_CANTRCVMORE; if (fip->fi_readers > 0) @@ -206,8 +205,7 @@ fifo_open(v) goto bad; } } - } - if (ap->a_mode & FWRITE) { + } else if (ap->a_mode & FWRITE) { if (ap->a_mode & O_NONBLOCK) { if (fip->fi_readers == 0) { error = ENXIO; @@ -363,8 +361,7 @@ fifo_select(v) ready = soo_select(&filetmp, ap->a_which, ap->a_p); if (ready) return (ready); - } - if (ap->a_fflags & FWRITE) { + } else if (ap->a_fflags & FWRITE) { filetmp.f_data = (caddr_t)ap->a_vp->v_fifoinfo->fi_writesock; ready = soo_select(&filetmp, ap->a_which, ap->a_p); if (ready) |