From ca6b79141bfa36231420b7adc6080faee5b63077 Mon Sep 17 00:00:00 2001 From: "Jared D. McNeill" Date: Thu, 22 Jan 2009 01:55:21 +0100 Subject: It is more portable to assume that SO_RCVBUF/SO_SNDBUF takes and int instead of a size_t Signed-off-by: Lennart Poettering --- src/pulsecore/socket-util.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/pulsecore/socket-util.c') diff --git a/src/pulsecore/socket-util.c b/src/pulsecore/socket-util.c index f721f699..a0920025 100644 --- a/src/pulsecore/socket-util.c +++ b/src/pulsecore/socket-util.c @@ -202,9 +202,11 @@ void pa_make_udp_socket_low_delay(int fd) { } int pa_socket_set_rcvbuf(int fd, size_t l) { + int bufsz = (int)l; + pa_assert(fd >= 0); - if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, (void*)&l, sizeof(l)) < 0) { + if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, (void*)&bufsz, sizeof(bufsz)) < 0) { pa_log_warn("SO_RCVBUF: %s", pa_cstrerror(errno)); return -1; } @@ -213,9 +215,11 @@ int pa_socket_set_rcvbuf(int fd, size_t l) { } int pa_socket_set_sndbuf(int fd, size_t l) { + int bufsz = (int)l; + pa_assert(fd >= 0); - if (setsockopt(fd, SOL_SOCKET, SO_SNDBUF, (void*)&l, sizeof(l)) < 0) { + if (setsockopt(fd, SOL_SOCKET, SO_SNDBUF, (void*)&bufsz, sizeof(bufsz)) < 0) { pa_log("SO_SNDBUF: %s", pa_cstrerror(errno)); return -1; } -- cgit