diff options
author | kib <kib@FreeBSD.org> | 2014-10-22 09:06:36 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2014-10-22 09:06:36 +0000 |
commit | 6809e3fc35d8e7dc281d790d54803f904703fec1 (patch) | |
tree | c4565b16782b7e6841080600fde8d36c1d191f91 /sys/fs | |
parent | a9088c78cbb8d67796643186d44ebf9b47727f6e (diff) | |
download | FreeBSD-src-6809e3fc35d8e7dc281d790d54803f904703fec1.zip FreeBSD-src-6809e3fc35d8e7dc281d790d54803f904703fec1.tar.gz |
MFC r273130:
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().
Diffstat (limited to 'sys/fs')
-rw-r--r-- | sys/fs/deadfs/dead_vnops.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/sys/fs/deadfs/dead_vnops.c b/sys/fs/deadfs/dead_vnops.c index 9a107dd..8c0ebcb 100644 --- a/sys/fs/deadfs/dead_vnops.c +++ b/sys/fs/deadfs/dead_vnops.c @@ -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 |