diff options
| author | John Lindgren <john@jlindgren.net> | 2022-02-28 08:54:47 -0500 |
|---|---|---|
| committer | Daniel Stone <daniels@collabora.com> | 2024-01-19 15:25:54 +0000 |
| commit | 9867bdb111f827e8e6f43e1c1111bb513811f3f1 (patch) | |
| tree | 4f56b348f0a8788b7e7280ef0424c9a98ee2732d /src | |
| parent | Consider pkgconfig sysroot for pkgdatadir (diff) | |
| download | wayland-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.c | 9 |
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; |
