handle: Return POLLOUT | POLLWRNORM mask when no messages are pending
authorMarcel Holtmann <marcel@holtmann.org>
Fri, 15 Aug 2014 19:43:37 +0000 (21:43 +0200)
committerDaniel Mack <zonque@gmail.com>
Fri, 15 Aug 2014 21:04:34 +0000 (23:04 +0200)
To facility the feature of doing an asynchronous sending of messages
when the bus is idle, make sure to return POLLOUT | POLLWRNORM from
kdbus_handle_poll.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
handle.c

index ac6868133280d1c037cd3f4f986d7929349d51a5..fc15d28351b35f81aa7349d73a57cfb7536f0f13 100644 (file)
--- a/handle.c
+++ b/handle.c
@@ -884,6 +884,8 @@ static unsigned int kdbus_handle_poll(struct file *file,
                mask |= POLLERR | POLLHUP;
        else if (!list_empty(&conn->msg_list))
                mask |= POLLIN | POLLRDNORM;
+       else
+               mask |= POLLOUT | POLLWRNORM;
        mutex_unlock(&conn->lock);
 
        return mask;