]> git.pld-linux.org Git - packages/amanda.git/blame - amanda-glib2.24.patch
- reorgnize glib_init to be compatible with glib-2.24+
[packages/amanda.git] / amanda-glib2.24.patch
CommitLineData
ba4191c3
JR
1--- amanda/trunk/common-src/glib-util.c 2009/10/16 22:06:51 2182
2+++ amanda/trunk/common-src/glib-util.c 2010/05/03 21:42:31 2982
3@@ -1,5 +1,5 @@
4 /*
5- * Copyright (c) 2007,2008,2009 Zmanda, Inc. All Rights Reserved.
6+ * Copyright (c) 2007, 2008, 2009, 2010 Zmanda, Inc. All Rights Reserved.
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License version 2 as published
10@@ -38,26 +38,15 @@
11 if (did_glib_init) return;
12 did_glib_init = TRUE;
13
14- /* Initialize glib's type system */
15- g_type_init();
16-
17 /* set up libcurl (this must happen before threading
18 * is initialized) */
19 #ifdef HAVE_LIBCURL
20 # ifdef G_THREADS_ENABLED
21- g_assert(!g_thread_supported());
22+ g_assert(!g_thread_supported()); /* assert threads aren't initialized yet */
23 # endif
24 g_assert(curl_global_init(CURL_GLOBAL_ALL) == 0);
25 #endif
26
27- /* And set up glib's threads */
28-#if defined(G_THREADS_ENABLED) && !defined(G_THREADS_IMPL_NONE)
29- if (g_thread_supported()) {
30- return;
31- }
32- g_thread_init(NULL);
33-#endif
34-
35 /* do a version check */
36 #if GLIB_CHECK_VERSION(2,6,0)
37 {
38@@ -71,6 +60,16 @@
39 }
40 }
41 #endif
42+
43+ /* Initialize glib's type system. On glib >= 2.24, this will initialize
44+ * threads, so it must be done after curl is initialized. */
45+ g_type_init();
46+
47+ /* And set up glib's threads */
48+#if defined(G_THREADS_ENABLED) && !defined(G_THREADS_IMPL_NONE)
49+ if (!g_thread_supported())
50+ g_thread_init(NULL);
51+#endif
52 }
53
54 typedef enum {
This page took 0.080209 seconds and 4 git commands to generate.