1 From: Simon McVittie <simon.mcvittie@collabora.co.uk>
2 Date: Mon, 15 Apr 2013 13:54:39 +0100
3 Subject: dbus_threads_init: call _dbus_threads_init_platform_specific()
5 This reverses the relationship between these two functions.
6 Previously, dbus_threads_init() wouldn't allocate dbus_cond_event_tls
7 on Windows, call check_monotonic_clock on Unix, or call
8 _dbus_check_setuid on Unix.
10 Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54972
11 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
12 Reviewed-by: Alban Crequy <alban.crequy@collabora.co.uk>
13 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
14 Applied-upstream: 1.7.4, commit:eabf6c42a1b779f57f2c08d35772035788657579
16 Change-Id: Ice70cf1f3e2202b72016daf619c89206b96aac47
18 dbus/dbus-sysdeps-pthread.c | 3 ++-
19 dbus/dbus-sysdeps-thread-win.c | 2 +-
20 dbus/dbus-threads.c | 7 ++++---
21 3 files changed, 7 insertions(+), 5 deletions(-)
23 diff --git a/dbus/dbus-sysdeps-pthread.c b/dbus/dbus-sysdeps-pthread.c
24 index c60457b..36a1e4b 100644
25 --- a/dbus/dbus-sysdeps-pthread.c
26 +++ b/dbus/dbus-sysdeps-pthread.c
27 @@ -281,5 +281,6 @@ _dbus_threads_init_platform_specific (void)
29 check_monotonic_clock ();
30 (void) _dbus_check_setuid ();
31 - return dbus_threads_init (NULL);
35 diff --git a/dbus/dbus-sysdeps-thread-win.c b/dbus/dbus-sysdeps-thread-win.c
36 index e30e7b8..4c4442a 100644
37 --- a/dbus/dbus-sysdeps-thread-win.c
38 +++ b/dbus/dbus-sysdeps-thread-win.c
39 @@ -269,6 +269,6 @@ _dbus_threads_init_platform_specific (void)
43 - return dbus_threads_init (NULL);
47 diff --git a/dbus/dbus-threads.c b/dbus/dbus-threads.c
48 index b464629..e7f2eb7 100644
49 --- a/dbus/dbus-threads.c
50 +++ b/dbus/dbus-threads.c
51 @@ -584,7 +584,8 @@ dbus_threads_init (const DBusThreadFunctions *functions)
52 if (thread_init_generation == _dbus_current_generation)
56 + if (!_dbus_threads_init_platform_specific() ||
60 thread_init_generation = _dbus_current_generation;
61 @@ -613,7 +614,7 @@ dbus_threads_init (const DBusThreadFunctions *functions)
63 dbus_threads_init_default (void)
65 - return _dbus_threads_init_platform_specific ();
66 + return dbus_threads_init (NULL);
70 @@ -624,7 +625,7 @@ dbus_threads_init_default (void)
72 _dbus_threads_init_debug (void)
74 - return _dbus_threads_init_platform_specific();
75 + return dbus_threads_init (NULL);
78 #endif /* DBUS_BUILD_TESTS */