Set POLLHUP even if no valid events were specified as per POSIX.
authormillert <millert@openbsd.org>
Sun, 10 May 2015 22:35:38 +0000 (22:35 +0000)
committermillert <millert@openbsd.org>
Sun, 10 May 2015 22:35:38 +0000 (22:35 +0000)
commitb7b44fe5796e416f560eb15867dc757db11a47d6
tree43200ee9dc037d16b8ec01bf207e4f187da941f0
parent04a4761205fc29c7f99b4c87efb3c069f628302b
Set POLLHUP even if no valid events were specified as per POSIX.
Since we use the poll backend for select(2), care must be taken not
to set the fd's bit in writefds in this case.  A kernel-only flag,
POLLNOHUP, is used by selscan() to tell the poll backend not to
return POLLHUP on EOF.  This is currently only used by fifo_poll().
The fifofs regress now passes.  OK guenther@
sys/kern/sys_generic.c
sys/miscfs/fifofs/fifo_vnops.c
sys/sys/poll.h