[systemd-devel] [PATCH kdbus] handle: Return POLLOUT | POLLWRNORM mask when no messages are pending

Marcel Holtmann marcel at holtmann.org
Fri Aug 15 12:43:37 PDT 2014


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 at holtmann.org>
---
 handle.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/handle.c b/handle.c
index ac6868133280..fc15d28351b3 100644
--- 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;
-- 
1.9.3



More information about the systemd-devel mailing list