vcs: poll(): cope with a deallocated vt
authorNicolas Pitre <nicolas.pitre@linaro.org>
Wed, 9 Jan 2019 03:55:03 +0000 (22:55 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 18 Jan 2019 12:47:55 +0000 (13:47 +0100)
commit1bf931ab94a963851aa1dfba5d9f03f9f1ad8637
treeadb2ec439b9266b37ba687da41094438ab19d348
parent8a085494317cab6fef25b34521dae03c83f31eaa
vcs: poll(): cope with a deallocated vt

When VT_DISALLOCATE is used on a vt, user space waiting with poll() on
the corresponding /dev/vcs device is not awakened. This is now fixed by
returning POLLHUP|POLLERR to user space.

Also, in the normal screen update case, we don't set POLLERR anymore as
POLLPRI alone is a much more logical response in a non-error situation,
saving some confusion on the user space side. The only known user app
making use of poll() on /dev/vcs* is BRLTTY which is known to cope with
that change already, so the risk of breakage is pretty much nonexistent.

Signed-off-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/vt/vc_screen.c