From: Simon McVittie Date: Fri, 21 Jan 2011 13:27:18 +0000 (+0000) Subject: _dbus_read_credentials_socket: support OpenBSD X-Git-Tag: dbus-1.4.4~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=edaa6fe253782dda959d78396b43e9fd71ea77e3;p=thirdparty%2Fdbus.git _dbus_read_credentials_socket: support OpenBSD OpenBSD SO_PEERCRED is nearly the same as Linux SO_PEERCRED, but the struct is named differently. Sigh. Based on a patch from 'ajacoutot'. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=32542 --- diff --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c index 81040730a..fdea63421 100644 --- a/dbus/dbus-sysdeps-unix.c +++ b/dbus/dbus-sysdeps-unix.c @@ -1660,7 +1660,11 @@ _dbus_read_credentials_socket (int client_fd, { #ifdef SO_PEERCRED +#ifdef __OpenBSD__ + struct sockpeercred cr; +#else struct ucred cr; +#endif int cr_len = sizeof (cr); if (getsockopt (client_fd, SOL_SOCKET, SO_PEERCRED, &cr, &cr_len) == 0 &&