From owner-freebsd-net Tue Dec 18 4:48:27 2001 Delivered-To: freebsd-net@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 6FD5B37B41B; Tue, 18 Dec 2001 04:48:18 -0800 (PST) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id XAA28380; Tue, 18 Dec 2001 23:48:15 +1100 Date: Tue, 18 Dec 2001 23:49:31 +1100 (EST) From: Bruce Evans X-X-Sender: To: Alfred Perlstein Cc: , , , Subject: Re: fifo fix (Re: cvs commit: src/sys/fs/fifofs fifo_vnops.c) In-Reply-To: <20011217122953.G82439@elvis.mu.org> Message-ID: <20011218234521.F3927-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Mon, 17 Dec 2001, Alfred Perlstein wrote: > * Bruce Evans [011217 07:10] wrote: > > > + > > > filetmp.f_data = (caddr_t)ap->a_vp->v_fifoinfo->fi_readsock; > > > + so = (struct socket *)filetmp.f_data; > > > + s = splnet(); > > > + oflg = so->so_state & SS_CANTRCVMORE; > > > + if (ap->a_vp->v_fifoinfo->fi_writers == 0) > > > + so->so_state &= ~SS_CANTRCVMORE; > > > if (filetmp.f_data) > > > revents |= soo_poll(&filetmp, ap->a_events, ap->a_cred, > > > ap->a_td); > > > + so->so_state |= oflg; > > > + splx(s); > > > > I'm not happy with frobbing the socket state. I suggest frobbing the > > events mask instead. Either use a flag to tell sopoll() to ignore > > SS_CANTRCVMORE, or use new events POLLIN_IGNORE_EOF and > > POLLRDNORM_IGNORE_EOF (convert the userland POLLIN/POLLRDNORM to these > > and change sopoll() to support them). > > I'll consider that. > > There's actually a bug here, I need to make sure 'so' isn't NULL > before I do this, sticking the frobbing under the 'if (filetmp.f_data)' > should fix that. Putting it there is almost exactly right, except for the bogus casts back and forth. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message