summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/glib-2.0/glib-2.0/ptest-dbus.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/glib-2.0/glib-2.0/ptest-dbus.patch')
-rw-r--r--meta/recipes-core/glib-2.0/glib-2.0/ptest-dbus.patch65
1 files changed, 65 insertions, 0 deletions
diff --git a/meta/recipes-core/glib-2.0/glib-2.0/ptest-dbus.patch b/meta/recipes-core/glib-2.0/glib-2.0/ptest-dbus.patch
new file mode 100644
index 0000000000..0db8fd1609
--- /dev/null
+++ b/meta/recipes-core/glib-2.0/glib-2.0/ptest-dbus.patch
@@ -0,0 +1,65 @@
1Fix dbus-appinfo from attempting to use the session's bus, and hanging if there
2isn't one present.
3
4Upstream-Status: Backport
5Signed-off-by: Ross Burton <ross.burton@intel.com>
6
7From 940fa98290812789d095d93ff1c550cd86fb2428 Mon Sep 17 00:00:00 2001
8From: Xavier Claessens <xavier.claessens@collabora.co.uk>
9Date: Mon, 28 Oct 2013 21:18:54 +0000
10Subject: Tests: add session_bus_run() and use it where possible
11
12This is to avoid having again the subtil bug in dbus-appinfo.c:
13session_bus_down() was called before g_test_run() so the test was
14running on the user's dbus session.
15
16https://bugzilla.gnome.org/show_bug.cgi?id=697348
17---
18diff --git a/gio/tests/dbus-appinfo.c b/gio/tests/dbus-appinfo.c
19index ca11e98..7698429 100644
20--- a/gio/tests/dbus-appinfo.c
21+++ b/gio/tests/dbus-appinfo.c
22@@ -280,11 +280,7 @@ main (int argc, char **argv)
23 {
24 g_test_init (&argc, &argv, NULL);
25
26- session_bus_up ();
27-
28 g_test_add_func ("/appinfo/dbusappinfo", test_dbus_appinfo);
29
30- session_bus_down ();
31-
32- return g_test_run ();
33+ return session_bus_run ();
34 }
35diff --git a/gio/tests/gdbus-sessionbus.c b/gio/tests/gdbus-sessionbus.c
36index 68c4449..13c2edb 100644
37--- a/gio/tests/gdbus-sessionbus.c
38+++ b/gio/tests/gdbus-sessionbus.c
39@@ -47,3 +47,14 @@ session_bus_down (void)
40 g_clear_object (&singleton);
41 }
42
43+gint
44+session_bus_run (void)
45+{
46+ gint ret;
47+
48+ session_bus_up ();
49+ ret = g_test_run ();
50+ session_bus_down ();
51+
52+ return ret;
53+}
54diff --git a/gio/tests/gdbus-sessionbus.h b/gio/tests/gdbus-sessionbus.h
55index 7ef3abd..284cd00 100644
56--- a/gio/tests/gdbus-sessionbus.h
57+++ b/gio/tests/gdbus-sessionbus.h
58@@ -30,6 +30,7 @@ G_BEGIN_DECLS
59 void session_bus_up (void);
60 void session_bus_stop (void);
61 void session_bus_down (void);
62+gint session_bus_run (void);
63
64 G_END_DECLS
65