aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohn Lindgren <john@jlindgren.net>2022-02-28 08:54:47 -0500
committerDaniel Stone <daniels@collabora.com>2024-01-19 15:25:54 +0000
commit9867bdb111f827e8e6f43e1c1111bb513811f3f1 (patch)
tree4f56b348f0a8788b7e7280ef0424c9a98ee2732d /src
parentConsider pkgconfig sysroot for pkgdatadir (diff)
downloadwayland-9867bdb111f827e8e6f43e1c1111bb513811f3f1.tar
wayland-9867bdb111f827e8e6f43e1c1111bb513811f3f1.tar.gz
wayland-9867bdb111f827e8e6f43e1c1111bb513811f3f1.tar.bz2
wayland-9867bdb111f827e8e6f43e1c1111bb513811f3f1.tar.lz
wayland-9867bdb111f827e8e6f43e1c1111bb513811f3f1.tar.xz
wayland-9867bdb111f827e8e6f43e1c1111bb513811f3f1.tar.zst
wayland-9867bdb111f827e8e6f43e1c1111bb513811f3f1.zip
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>
Diffstat (limited to 'src')
-rw-r--r--src/connection.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/connection.c b/src/connection.c
index f2e5837..bcee87e 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -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;