$OpenBSD: patch-dbus_dbus-sysdeps-unix_c,v 1.9 2010/12/21 14:59:49 ajacoutot Exp $
--- dbus/dbus-sysdeps-unix.c.orig	Thu Dec 16 14:53:48 2010
+++ dbus/dbus-sysdeps-unix.c	Tue Dec 21 15:18:05 2010
@@ -204,7 +204,7 @@ _dbus_write_socket (int               fd,
                     int               start,
                     int               len)
 {
-#ifdef HAVE_DECL_MSG_NOSIGNAL
+#if HAVE_DECL_MSG_NOSIGNAL
   const char *data;
   int bytes_written;
 
@@ -442,7 +442,7 @@ _dbus_write_socket_with_unix_fds_two(int              
  again:
 
   bytes_written = sendmsg (fd, &m, 0
-#ifdef HAVE_DECL_MSG_NOSIGNAL
+#if HAVE_DECL_MSG_NOSIGNAL
                            |MSG_NOSIGNAL
 #endif
                            );
@@ -481,7 +481,7 @@ _dbus_write_socket_two (int               fd,
                         int               start2,
                         int               len2)
 {
-#ifdef HAVE_DECL_MSG_NOSIGNAL
+#if HAVE_DECL_MSG_NOSIGNAL
   struct iovec vectors[2];
   const char *data1;
   const char *data2;
@@ -1494,13 +1494,13 @@ write_credentials_byte (int             server_fd,
 
 #if defined(HAVE_CMSGCRED)
   bytes_written = sendmsg (server_fd, &msg, 0
-#ifdef HAVE_DECL_MSG_NOSIGNAL
+#if HAVE_DECL_MSG_NOSIGNAL
                            |MSG_NOSIGNAL
 #endif
                            );
 #else
   bytes_written = send (server_fd, buf, 1, 0
-#ifdef HAVE_DECL_MSG_NOSIGNAL
+#if HAVE_DECL_MSG_NOSIGNAL
                         |MSG_NOSIGNAL
 #endif
                         );
@@ -1658,7 +1658,11 @@ _dbus_read_credentials_socket  (int              clien
 
   {
 #ifdef SO_PEERCRED
+#ifndef __OpenBSD__
     struct ucred cr;
+#else
+    struct sockpeercred cr;
+#endif
     int cr_len = sizeof (cr);
 
     if (getsockopt (client_fd, SOL_SOCKET, SO_PEERCRED, &cr, &cr_len) == 0 &&
