summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLaurent Bigonville <bigon@bigon.be>2021-12-16 16:17:13 +0100
committerLaurent Bigonville <bigon@bigon.be>2021-12-16 16:17:13 +0100
commitea205553781eb371005de42de829775401a69354 (patch)
treebaecfc6ca043b3e50e9e1ff0a9ddafeed9f5821d /src
parenta9cc1373e2a79396569b2fe6164797b0ed0cb3d1 (diff)
downloadpulseaudio-ea205553781eb371005de42de829775401a69354.tar.gz
iochannel: Fix FTBFS on GNU/Hurd
This is a followup patch for 0efc38e95fafa84934da9c03c200303cac7da16a Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/671>
Diffstat (limited to 'src')
-rw-r--r--src/pulsecore/iochannel.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/pulsecore/iochannel.c b/src/pulsecore/iochannel.c
index a03200dcb..002513839 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
-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__GNU__)
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) {
-#if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__)
+#if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__) && !defined(__GNU__)
int t = 1;
#endif
pa_assert(io);
pa_assert(io->ifd >= 0);
-#if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__)
+#if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__) && !defined(__GNU__)
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);
-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__GNU__)
// 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));
-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__GNU__)
ancil_data->creds.gid = u.cmcred_gid;
ancil_data->creds.uid = u.cmcred_uid;
#else