From 0efc38e95fafa84934da9c03c200303cac7da16a Mon Sep 17 00:00:00 2001 From: Laurent Bigonville Date: Tue, 13 Jul 2021 10:49:01 +0200 Subject: [PATCH] iochannel: Fix FTBFS on Debian kfreebsd Fixes: #1233 Part-of: --- src/pulsecore/iochannel.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pulsecore/iochannel.c b/src/pulsecore/iochannel.c index 38b79d173..a03200dcb 100644 --- a/src/pulsecore/iochannel.c +++ b/src/pulsecore/iochannel.c @@ -261,7 +261,7 @@ ssize_t pa_iochannel_read(pa_iochannel*io, void*data, size_t l) { #ifdef HAVE_CREDS -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) typedef struct cmsgcred pa_ucred_t; #define SCM_CREDENTIALS SCM_CREDS #else @@ -291,14 +291,14 @@ bool pa_iochannel_creds_supported(pa_iochannel *io) { } int pa_iochannel_creds_enable(pa_iochannel *io) { -#ifndef __FreeBSD__ +#if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__) int t = 1; #endif pa_assert(io); 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) { pa_log_error("setsockopt(SOL_SOCKET, SO_PASSCRED): %s", pa_cstrerror(errno)); 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); -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) // the kernel fills everything #else 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_assert(cmh->cmsg_len == CMSG_LEN(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.uid = u.cmcred_uid; #else