1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-18 10:35:55 +00:00

Change the deadfs poll VOP to return POLLIN|POLLRDNORM if the caller

is interested in i/o state.  Return POLLNVAL for invalid bits, similar
to poll_no_poll().  Note that POLLOUT must not be returned, since
POLLHUP is set.

Noted and reviewed by:	bde
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
This commit is contained in:
Konstantin Belousov 2014-10-15 13:08:53 +00:00
parent f821fad417
commit dd0218f2bd
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=273130

View File

@ -163,16 +163,19 @@ dead_write(ap)
return (EIO);
}
/*
* Trivial poll routine that always returns POLLHUP.
* This is necessary so that a process which is polling a file
* gets notified when that file is revoke()d.
*/
static int
dead_poll(ap)
struct vop_poll_args *ap;
{
return (POLLHUP);
if (ap->a_events & ~POLLSTANDARD)
return (POLLNVAL);
/*
* Let the user find out that the descriptor is gone.
*/
return (POLLHUP | ((POLLIN | POLLRDNORM) & ap->a_events));
}
static int