Enable test_peer regress test on OpenBSD.

This commit is contained in:
ajacoutot 2011-10-08 09:51:44 +00:00
parent a9b2902d6d
commit 079b669f60

View File

@ -1,12 +1,25 @@
$OpenBSD: patch-gio_tests_gdbus-peer_c,v 1.1 2011/09/20 21:09:34 ajacoutot Exp $
--- gio/tests/gdbus-peer.c.orig Tue Sep 20 00:33:14 2011
+++ gio/tests/gdbus-peer.c Tue Sep 20 00:34:39 2011
@@ -39,6 +39,8 @@
#include <gio/gunixsocketaddress.h>
#include <gio/gunixfdlist.h>
+#include <sys/socket.h>
+
/* used in test_overflow */
#ifdef G_OS_UNIX
#include <gio/gunixconnection.h>
$OpenBSD: patch-gio_tests_gdbus-peer_c,v 1.2 2011/10/08 09:51:44 ajacoutot Exp $
https://bugzilla.gnome.org/show_bug.cgi?id=661255
--- gio/tests/gdbus-peer.c.orig Thu Sep 15 02:01:00 2011
+++ gio/tests/gdbus-peer.c Sat Oct 8 11:43:57 2011
@@ -795,6 +795,18 @@ test_peer (void)
g_assert (native_creds->pid == getpid ());
}
g_object_unref (credentials);
+#elif defined (__OpenBSD__)
+ {
+ struct sockpeercred *native_creds;
+ g_assert_no_error (error);
+ g_assert (G_IS_CREDENTIALS (credentials));
+ native_creds = g_credentials_get_native (credentials, G_CREDENTIALS_TYPE_OPENBSD_SOCKPEERCRED);
+ g_assert (native_creds != NULL);
+ g_assert (native_creds->uid == getuid ());
+ g_assert (native_creds->gid == getgid ());
+ g_assert (native_creds->pid == getpid ());
+ }
+ g_object_unref (credentials);
#else
g_assert_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED);
g_assert (credentials == NULL);