handle: return POLLOUT | POLLWRNORM from kdbus_handle_poll()
authorDaniel Mack <zonque@gmail.com>
Mon, 18 Aug 2014 15:07:49 +0000 (17:07 +0200)
committerDaniel Mack <zonque@gmail.com>
Mon, 18 Aug 2014 15:07:58 +0000 (17:07 +0200)
Also return POLLOUT | POLLWRNORM from kdbus_handle_poll() when a message
arrived. IOW: in all non-error conditions.

handle.c

index d9a2e1a81d0885566feec0c3ca87a38a873c7a57..adcb5456a81d0dc55caeb253994daf6a8cea3208 100644 (file)
--- 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;