aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches/glib-tests-newnet.patch
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-10-17 23:50:11 +0200
committerLudovic Courtès <ludo@gnu.org>2013-10-17 23:50:32 +0200
commit93a3d8f6099a733c05295a0e8d8358db1d930937 (patch)
tree0735c8f42ab76eb1cfc6ec0bba1680418c27ef44 /gnu/packages/patches/glib-tests-newnet.patch
parent96e424672aa28cd603d94efd05f1fead152da0ee (diff)
downloadguix-93a3d8f6099a733c05295a0e8d8358db1d930937.tar
guix-93a3d8f6099a733c05295a0e8d8358db1d930937.tar.gz
gnu: glib: Work around test failure in 'gio/tests/network-address.c'.
* gnu/packages/patches/glib-tests-newnet.patch: New file. * gnu/packages/glib.scm (glib): Use it. * gnu-system.am (dist_patch_DATA): Add it.
Diffstat (limited to 'gnu/packages/patches/glib-tests-newnet.patch')
-rw-r--r--gnu/packages/patches/glib-tests-newnet.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/gnu/packages/patches/glib-tests-newnet.patch b/gnu/packages/patches/glib-tests-newnet.patch
new file mode 100644
index 0000000000..324b8ae68f
--- /dev/null
+++ b/gnu/packages/patches/glib-tests-newnet.patch
@@ -0,0 +1,30 @@
+Since guix-daemon runs in a separate networking name space, the only
+interface available is "lo". However its index is incremented by one
+at each build, so it can end up being greater than 255, leading to an
+assertion failure in 'find_ifname_and_index'.
+
+Work around that by directly querying the index of "lo".
+
+--- glib-2.38.0/gio/tests/network-address.c 2013-09-17 20:47:14.000000000 +0200
++++ glib-2.38.0/gio/tests/network-address.c 2013-10-16 21:52:42.000000000 +0200
+@@ -117,7 +117,7 @@ test_parse_host (gconstpointer d)
+ #define SCOPE_ID_TEST_PORT 99
+
+ #ifdef HAVE_IF_INDEXTONAME
+-static char SCOPE_ID_TEST_IFNAME[IF_NAMESIZE];
++static char SCOPE_ID_TEST_IFNAME[] = "lo";
+ static int SCOPE_ID_TEST_INDEX;
+ #else
+ #define SCOPE_ID_TEST_IFNAME "1"
+@@ -131,11 +131,7 @@ find_ifname_and_index (void)
+ return;
+
+ #ifdef HAVE_IF_INDEXTONAME
+- for (SCOPE_ID_TEST_INDEX = 1; SCOPE_ID_TEST_INDEX < 255; SCOPE_ID_TEST_INDEX++) {
+- if (if_indextoname (SCOPE_ID_TEST_INDEX, SCOPE_ID_TEST_IFNAME))
+- break;
+- }
+- g_assert_cmpstr (SCOPE_ID_TEST_IFNAME, !=, "");
++ SCOPE_ID_TEST_INDEX = if_nametoindex (SCOPE_ID_TEST_IFNAME);
+ #endif
+ }