diff options
author | Jared D. McNeill <jmcneill@NetBSD.org> | 2009-01-22 01:55:21 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2009-01-22 01:55:21 +0100 |
commit | ca6b79141bfa36231420b7adc6080faee5b63077 (patch) | |
tree | a2f9874c8d664f6be5bd92b88b9c1823b7089ad4 /src/pulsecore/socket-util.c | |
parent | 8d89ccdcf2d3aed41688a2933ebc58942e93bb45 (diff) |
It is more portable to assume that SO_RCVBUF/SO_SNDBUF takes and int instead of a size_t
Signed-off-by: Lennart Poettering <lennart@poettering.net>
Diffstat (limited to 'src/pulsecore/socket-util.c')
-rw-r--r-- | src/pulsecore/socket-util.c | 8 |
1 files changed, 6 insertions, 2 deletions
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; } |