aboutsummaryrefslogtreecommitdiffstats
path: root/src/connection.c
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2017-04-13 11:51:51 -0500
committerDaniel Stone <daniels@collabora.com>2017-12-04 22:22:47 +0000
commita46d89de9aaad325ea908a39a1a58edfabc95918 (patch)
treec3bec1d121acae497e2f171b62a32fcbf31632dc /src/connection.c
parentclient: Simplify some logic in queue_event (diff)
downloadwayland-a46d89de9aaad325ea908a39a1a58edfabc95918.tar
wayland-a46d89de9aaad325ea908a39a1a58edfabc95918.tar.gz
wayland-a46d89de9aaad325ea908a39a1a58edfabc95918.tar.bz2
wayland-a46d89de9aaad325ea908a39a1a58edfabc95918.tar.lz
wayland-a46d89de9aaad325ea908a39a1a58edfabc95918.tar.xz
wayland-a46d89de9aaad325ea908a39a1a58edfabc95918.tar.zst
wayland-a46d89de9aaad325ea908a39a1a58edfabc95918.zip
connection: Use wl_buffer_size() for all buffer size calculations
There were two places where we did the same calculation manually. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
Diffstat (limited to 'src/connection.c')
-rw-r--r--src/connection.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/connection.c b/src/connection.c
index 7fe35b5..e60ad75 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -178,7 +178,7 @@ close_fds(struct wl_buffer *buffer, int max)
int32_t fds[sizeof(buffer->data) / sizeof(int32_t)], i, count;
size_t size;
- size = buffer->head - buffer->tail;
+ size = wl_buffer_size(buffer);
if (size == 0)
return;
@@ -222,7 +222,7 @@ build_cmsg(struct wl_buffer *buffer, char *data, int *clen)
struct cmsghdr *cmsg;
size_t size;
- size = buffer->head - buffer->tail;
+ size = wl_buffer_size(buffer);
if (size > MAX_FDS_OUT * sizeof(int32_t))
size = MAX_FDS_OUT * sizeof(int32_t);