$OpenBSD: patch-gio_tests_socket_c,v 1.6 2013/01/09 15:32:33 ajacoutot Exp $

From cb1876b4a7e2d1c91fcf461515d5a7933c62c6ff Mon Sep 17 00:00:00 2001
From: Antoine Jacoutot <ajacoutot@gnome.org>
Date: Wed, 09 Jan 2013 15:29:29 +0000
Subject: ipv6_v4mapped: force pass even if we don't speak IPv4

From 475edeb2edad68b4bef818deb7ee7db92598397f Mon Sep 17 00:00:00 2001
From: Antoine Jacoutot <ajacoutot@gnome.org>
Date: Fri, 19 Oct 2012 12:34:18 +0000
Subject: Allow slightly too big poll duration in /socket/timed_wait test

--- gio/tests/socket.c.orig	Mon Nov 26 17:52:48 2012
+++ gio/tests/socket.c	Wed Jan  9 16:31:40 2013
@@ -106,6 +106,12 @@ create_server (GSocketFamily family,
       fd = g_socket_get_fd (server);
       v6_only = 0;
       setsockopt (fd, IPPROTO_IPV6, IPV6_V6ONLY, &v6_only, sizeof (v6_only));
+      if (! g_socket_speaks_ipv4 (data->server))
+        {
+          g_object_unref (data->server);
+          g_slice_free (IPTestData, data);
+          return NULL;
+        }
     }
 #endif
 
@@ -549,6 +555,12 @@ test_ipv6_v4mapped (void)
 
   data = create_server (G_SOCKET_FAMILY_IPV6, v4mapped_server_thread, TRUE);
 
+  if (data == NULL)
+    {
+      g_test_message ("Test not run: not supported by the OS");
+      return;
+    }
+
   client = g_socket_new (G_SOCKET_FAMILY_IPV4,
 			 G_SOCKET_TYPE_STREAM,
 			 G_SOCKET_PROTOCOL_DEFAULT,
@@ -617,7 +629,7 @@ test_timed_wait (void)
   poll_duration = g_get_monotonic_time () - start_time;
 
   g_assert_cmpint (poll_duration, >=, 98000);
-  g_assert_cmpint (poll_duration, <, 110000);
+  g_assert_cmpint (poll_duration, <, 112000);
 
   g_socket_close (client, &error);
   g_assert_no_error (error);
