cdev: introduce client 'dead' state
authorDavid Herrmann <dh.herrmann@googlemail.com>
Sun, 2 Dec 2012 10:03:40 +0000 (11:03 +0100)
committerDavid Herrmann <dh.herrmann@googlemail.com>
Sun, 2 Dec 2012 10:03:40 +0000 (11:03 +0100)
commit653ceff5b00a8dd43e34e1e4a321a3e66a713c5e
tree449b80eeea86351e1c7405b95794652138409f65
parentd0e625f07479d5137cedce15b393c2c0e948dfca
cdev: introduce client 'dead' state

Files have the disadvantage that the kernel (or in this case 'we') cannot
force a client to close it. Instead, we have to mark it as 'dead' and wait
until the client closes the file theirself.
While marked as 'dead' we always return EPIPE or signal EPOLLHUP so the
client will notice that the file is dead.

This fixes a bug where when we forced an unregistration of a cdev session,
the cdev_client went away too early and the user still had the file open.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
src/kmscon_cdev.c