From d0e625f07479d5137cedce15b393c2c0e948dfca Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Sun, 2 Dec 2012 11:02:17 +0100 Subject: [PATCH] cdev: fix copying pollhandles correctly The pollhandle is solely implemented in libfuse and does not correspond to some kernel-intern object. Instead, the kernel notifies us when it has poll-waiters via a flag. If that flag is set we should notify the kernel whenever the poll-flags change. Therefore, we can safely copy the pollhandle all the time and delete our temporary handles. Signed-off-by: David Herrmann --- src/kmscon_cdev.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/kmscon_cdev.c b/src/kmscon_cdev.c index 29eb483..6bdd0b7 100644 --- a/src/kmscon_cdev.c +++ b/src/kmscon_cdev.c @@ -678,10 +678,9 @@ static void ll_poll(fuse_req_t req, struct fuse_file_info *fi, return; } - if (client->ph) { + if (client->ph) fuse_pollhandle_destroy(client->ph); - client->ph = ph; - } + client->ph = ph; flags = EPOLLOUT | EPOLLWRNORM; if (!shl_ring_is_empty(client->ring))