mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
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>
This commit is contained in:
parent
8d89ccdcf2
commit
ca6b79141b
1 changed files with 6 additions and 2 deletions
|
|
@ -202,9 +202,11 @@ void pa_make_udp_socket_low_delay(int fd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int pa_socket_set_rcvbuf(int fd, size_t l) {
|
int pa_socket_set_rcvbuf(int fd, size_t l) {
|
||||||
|
int bufsz = (int)l;
|
||||||
|
|
||||||
pa_assert(fd >= 0);
|
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));
|
pa_log_warn("SO_RCVBUF: %s", pa_cstrerror(errno));
|
||||||
return -1;
|
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 pa_socket_set_sndbuf(int fd, size_t l) {
|
||||||
|
int bufsz = (int)l;
|
||||||
|
|
||||||
pa_assert(fd >= 0);
|
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));
|
pa_log("SO_SNDBUF: %s", pa_cstrerror(errno));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue