From d19902630823b970fb705c32e96e9d74a877faaf Mon Sep 17 00:00:00 2001 From: Daniel Mack Date: Mon, 18 Aug 2014 17:07:49 +0200 Subject: [PATCH] handle: return POLLOUT | POLLWRNORM from kdbus_handle_poll() Also return POLLOUT | POLLWRNORM from kdbus_handle_poll() when a message arrived. IOW: in all non-error conditions. --- handle.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/handle.c b/handle.c index d9a2e1a..adcb545 100644 --- a/handle.c +++ b/handle.c @@ -802,7 +802,7 @@ static unsigned int kdbus_handle_poll(struct file *file, { struct kdbus_handle *handle = file->private_data; struct kdbus_conn *conn = handle->conn; - unsigned int mask = 0; + unsigned int mask = POLLOUT | POLLWRNORM; /* Only a connected endpoint can read/write data */ if (handle->type != KDBUS_HANDLE_EP_CONNECTED) @@ -812,11 +812,9 @@ static unsigned int kdbus_handle_poll(struct file *file, mutex_lock(&conn->lock); if (!kdbus_conn_active(conn)) - mask |= POLLERR | POLLHUP; + mask = POLLERR | POLLHUP; else if (!list_empty(&conn->msg_list)) mask |= POLLIN | POLLRDNORM; - else - mask |= POLLOUT | POLLWRNORM; mutex_unlock(&conn->lock); return mask; -- 2.34.1