kern/94772: FIFOs (named pipes) + select() == broken

Oliver Fromme olli at lurza.secnetix.de
Fri Mar 24 20:50:29 UTC 2006


The following reply was made to PR kern/94772; it has been noted by GNATS.

From: Oliver Fromme <olli at lurza.secnetix.de>
To: bde at zeta.org.au (Bruce Evans)
Cc: bug-followup at freebsd.org
Subject: Re: kern/94772: FIFOs (named pipes) + select() == broken
Date: Fri, 24 Mar 2006 21:49:29 +0100 (CET)

 Oliver Fromme wrote:
  > Oh, by the way, the patch set that I mailed still has
  > two failure cases with nameless pipes (I didn't notice
  > at first because I only tested the NAMEDPIPE case):
  > 
  > not ok 4  Pipe state 6a: expected POLLHUP; got POLLIN | POLLHUP
  > not ok 8  Pipe state 6a: expected POLLHUP; got POLLIN | POLLHUP
  > 
  > Those were broken before, too, so my patch doesn't make
  > things worse, at least.  :-)   I'll try to fix those,
  > too.
 
 Those were easy to fix.  It's basically a patch that just
 removes one line in kern/sys_pipe.c:pipe_poll().  This
 patch is independent from the others and can be applied
 separately.  I've added it to the patchset on my website:
 http://www.secnetix.de/~olli/tmp/fifodiff.txt
 
 Now _all_ current checks from the test programs are
 successful, both select() and poll(), and both for FIFOs
 and for nameless pipes.
 
 Best regards
    Oliver
 
 --- src/sys/kern/sys_pipe.c.orig	Tue Jan 31 16:44:51 2006
 +++ src/sys/kern/sys_pipe.c	Fri Mar 24 19:23:03 2006
 @@ -1350,8 +1350,7 @@
  #endif
  	if (events & (POLLIN | POLLRDNORM))
  		if ((rpipe->pipe_state & PIPE_DIRECTW) ||
 -		    (rpipe->pipe_buffer.cnt > 0) ||
 -		    (rpipe->pipe_state & PIPE_EOF))
 +		    (rpipe->pipe_buffer.cnt > 0))
  			revents |= events & (POLLIN | POLLRDNORM);
  
  	if (events & (POLLOUT | POLLWRNORM))
 
 
 
 -- 
 Oliver Fromme,  secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing
 Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd
 Any opinions expressed in this message may be personal to the author
 and may not necessarily reflect the opinions of secnetix in any way.
 
 "In My Egoistical Opinion, most people's C programs should be indented
 six feet downward and covered with dirt."
         -- Blair P. Houghton


More information about the freebsd-bugs mailing list