mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-10-29 05:40:16 -04:00
connection: Small simplification to wl_connection_write()
wl_connection_write() contained an exact copy of the logic in wl_connection_queue(). Simplify things by just calling wl_connection_queue() from wl_connection_write(). Signed-off-by: John Lindgren <john@jlindgren.net>
This commit is contained in:
parent
8c49ee3112
commit
9867bdb111
1 changed files with 1 additions and 8 deletions
|
|
@ -382,14 +382,7 @@ int
|
|||
wl_connection_write(struct wl_connection *connection,
|
||||
const void *data, size_t count)
|
||||
{
|
||||
if (connection->out.head - connection->out.tail +
|
||||
count > ARRAY_LENGTH(connection->out.data)) {
|
||||
connection->want_flush = 1;
|
||||
if (wl_connection_flush(connection) < 0)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (ring_buffer_put(&connection->out, data, count) < 0)
|
||||
if (wl_connection_queue(connection, data, count) < 0)
|
||||
return -1;
|
||||
|
||||
connection->want_flush = 1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue