*
* Returns 0 on success.
* If @ensure_msg_list_empty is true, and the connection has pending messages,
- * -EAGAIN is returned.
+ * -EBUSY is returned.
*/
int kdbus_conn_disconnect(struct kdbus_conn *conn, bool ensure_msg_list_empty)
{
if (ensure_msg_list_empty && !list_empty(&conn->msg_list)) {
mutex_unlock(&conn->lock);
- return -EAGAIN;
+ return -EBUSY;
}
conn->disconnected = true;
* @EBADFD: A bus connection is in a corrupted state.
* @EBADMSG: Passed data contains a combination of conflicting or
* inconsistent types.
+ * @EBUSY: The user tried to say BYEBYE to a connection, but the
+ * connection had a non-empty message list.
* @ECONNRESET: A connection is shut down, no further operations are
* possible.
* @ECOMM: A peer does not accept the file descriptors addressed
/* say byebye on the 2nd, which must fail */
ret = ioctl(conn->fd, KDBUS_CMD_BYEBYE, 0);
- ASSERT_RETURN(ret == -1 && errno == EAGAIN);
+ ASSERT_RETURN(ret == -1 && errno == EBUSY);
/* receive the message */
ret = ioctl(conn->fd, KDBUS_CMD_MSG_RECV, &off);