[pulseaudio-commits] [Git][pulseaudio/pulseaudio][master] iochannel: Fix FTBFS on Debian kfreebsd
PulseAudio Marge Bot (@pulseaudio-merge-bot)
gitlab at gitlab.freedesktop.org
Wed Jul 14 15:07:10 UTC 2021
PulseAudio Marge Bot pushed to branch master at PulseAudio / pulseaudio
Commits:
0efc38e9 by Laurent Bigonville at 2021-07-13T10:49:01+02:00
iochannel: Fix FTBFS on Debian kfreebsd
Fixes: #1233
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/605>
- - - - -
1 changed file:
- src/pulsecore/iochannel.c
Changes:
=====================================
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
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/0efc38e95fafa84934da9c03c200303cac7da16a
--
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/0efc38e95fafa84934da9c03c200303cac7da16a
You're receiving this email because of your account on gitlab.freedesktop.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pulseaudio-commits/attachments/20210714/a70c870e/attachment-0001.htm>
More information about the pulseaudio-commits
mailing list