mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-10-29 05:40:16 -04:00
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>
This commit is contained in:
parent
56696e5148
commit
a46d89de9a
1 changed files with 2 additions and 2 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue