Fix dbus with tizen patch
[scm/bb/meta-tizen.git] / recipes-core / dbus / files / 0004-dbus_threads_init-call-_dbus_threads_init_platform_s.patch
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()
4
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.
9
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
15 Bug-Tizen: TZPC-1971
16 Change-Id: Ice70cf1f3e2202b72016daf619c89206b96aac47
17 ---
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(-)
22
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)
28     */
29    check_monotonic_clock ();
30    (void) _dbus_check_setuid ();
31 -  return dbus_threads_init (NULL);
32 +
33 +  return TRUE;
34  }
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)
40         return FALSE;
41      }
42  
43 -  return dbus_threads_init (NULL);
44 +  return TRUE;
45  }
46  
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)
53      return TRUE;
54  
55 -  if (!init_locks ())
56 +  if (!_dbus_threads_init_platform_specific() ||
57 +      !init_locks ())
58      return FALSE;
59  
60    thread_init_generation = _dbus_current_generation;
61 @@ -613,7 +614,7 @@ dbus_threads_init (const DBusThreadFunctions *functions)
62  dbus_bool_t
63  dbus_threads_init_default (void)
64  {
65 -  return _dbus_threads_init_platform_specific ();
66 +  return dbus_threads_init (NULL);
67  }
68  
69  
70 @@ -624,7 +625,7 @@ dbus_threads_init_default (void)
71  dbus_bool_t
72  _dbus_threads_init_debug (void)
73  {
74 -  return _dbus_threads_init_platform_specific();
75 +  return dbus_threads_init (NULL);
76  }
77  
78  #endif /* DBUS_BUILD_TESTS */