mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-01 22:58:47 -04:00
iochannel: Fix FTBFS on Debian kfreebsd
Fixes: #1233 Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/605>
This commit is contained in:
parent
5febac482d
commit
0efc38e95f
1 changed files with 5 additions and 5 deletions
|
|
@ -261,7 +261,7 @@ ssize_t pa_iochannel_read(pa_iochannel*io, void*data, size_t l) {
|
||||||
|
|
||||||
#ifdef HAVE_CREDS
|
#ifdef HAVE_CREDS
|
||||||
|
|
||||||
#ifdef __FreeBSD__
|
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||||
typedef struct cmsgcred pa_ucred_t;
|
typedef struct cmsgcred pa_ucred_t;
|
||||||
#define SCM_CREDENTIALS SCM_CREDS
|
#define SCM_CREDENTIALS SCM_CREDS
|
||||||
#else
|
#else
|
||||||
|
|
@ -291,14 +291,14 @@ bool pa_iochannel_creds_supported(pa_iochannel *io) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int pa_iochannel_creds_enable(pa_iochannel *io) {
|
int pa_iochannel_creds_enable(pa_iochannel *io) {
|
||||||
#ifndef __FreeBSD__
|
#if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__)
|
||||||
int t = 1;
|
int t = 1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
pa_assert(io);
|
pa_assert(io);
|
||||||
pa_assert(io->ifd >= 0);
|
pa_assert(io->ifd >= 0);
|
||||||
|
|
||||||
#ifndef __FreeBSD__
|
#if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__)
|
||||||
if (setsockopt(io->ifd, SOL_SOCKET, SO_PASSCRED, &t, sizeof(t)) < 0) {
|
if (setsockopt(io->ifd, SOL_SOCKET, SO_PASSCRED, &t, sizeof(t)) < 0) {
|
||||||
pa_log_error("setsockopt(SOL_SOCKET, SO_PASSCRED): %s", pa_cstrerror(errno));
|
pa_log_error("setsockopt(SOL_SOCKET, SO_PASSCRED): %s", pa_cstrerror(errno));
|
||||||
return -1;
|
return -1;
|
||||||
|
|
@ -334,7 +334,7 @@ ssize_t pa_iochannel_write_with_creds(pa_iochannel*io, const void*data, size_t l
|
||||||
|
|
||||||
u = (pa_ucred_t*) CMSG_DATA(&cmsg.hdr);
|
u = (pa_ucred_t*) CMSG_DATA(&cmsg.hdr);
|
||||||
|
|
||||||
#ifdef __FreeBSD__
|
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||||
// the kernel fills everything
|
// the kernel fills everything
|
||||||
#else
|
#else
|
||||||
u->pid = getpid();
|
u->pid = getpid();
|
||||||
|
|
@ -457,7 +457,7 @@ ssize_t pa_iochannel_read_with_ancil_data(pa_iochannel*io, void*data, size_t l,
|
||||||
pa_ucred_t u;
|
pa_ucred_t u;
|
||||||
pa_assert(cmh->cmsg_len == CMSG_LEN(sizeof(pa_ucred_t)));
|
pa_assert(cmh->cmsg_len == CMSG_LEN(sizeof(pa_ucred_t)));
|
||||||
memcpy(&u, CMSG_DATA(cmh), sizeof(pa_ucred_t));
|
memcpy(&u, CMSG_DATA(cmh), sizeof(pa_ucred_t));
|
||||||
#ifdef __FreeBSD__
|
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||||
ancil_data->creds.gid = u.cmcred_gid;
|
ancil_data->creds.gid = u.cmcred_gid;
|
||||||
ancil_data->creds.uid = u.cmcred_uid;
|
ancil_data->creds.uid = u.cmcred_uid;
|
||||||
#else
|
#else
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue