Re: FIFO fd not marked readable after EOF

2014-10-09 Thread Todd C. Miller
Here is a better diff that passes the newly-updated regress test. It does two extra things: 1) causes POLLHUP to be returned in revents on EOF 2) clears the EOF condition on read so when another writer connects we don't still have an EOF pending Ultimately we should investigate using a

Re: FIFO fd not marked readable after EOF

2014-10-07 Thread Dimitris Papastamos
On Mon, Oct 06, 2014 at 04:56:08PM -0600, Todd C. Miller wrote: The following diff should fix it. - todd Index: sys/miscfs/fifofs/fifo_vnops.c === RCS file: /home/cvs/openbsd/src/sys/miscfs/fifofs/fifo_vnops.c,v retrieving

FIFO fd not marked readable after EOF

2014-10-06 Thread Dimitris Papastamos
Hi everyone, I am using select(2) on a FIFO fd and monitoring for readability. select(2) doesn't return after the writer exits. The same piece of code marks the fd as readable on Linux. Not sure which behaviour is correct though. Doing a very similar test with stdin and closing it before the

Re: FIFO fd not marked readable after EOF

2014-10-06 Thread Dimitris Papastamos
On Mon, Oct 06, 2014 at 01:08:57PM +0100, Dimitris Papastamos wrote: The same piece of code marks the fd as readable on Linux. I tested on NetBSD and it also seems to mark the fd readable. Doing a very similar test with stdin and closing it before the call to select(2) behaves as expected and

Re: FIFO fd not marked readable after EOF

2014-10-06 Thread Matthew Dempsky
On Mon, Oct 6, 2014 at 5:08 AM, Dimitris Papastamos s...@2f30.org wrote: I am using select(2) on a FIFO fd and monitoring for readability. select(2) doesn't return after the writer exits. The same piece of code marks the fd as readable on Linux. Not sure which behaviour is correct though.

Re: FIFO fd not marked readable after EOF

2014-10-06 Thread Todd C. Miller
The following diff should fix it. - todd Index: sys/miscfs/fifofs/fifo_vnops.c === RCS file: /home/cvs/openbsd/src/sys/miscfs/fifofs/fifo_vnops.c,v retrieving revision 1.41 diff -u -r1.41 fifo_vnops.c ---