summaryrefslogtreecommitdiff
path: root/libnm-util
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2015-05-15 18:27:19 +0200
committerLubomir Rintel <lkundrak@v3.sk>2015-06-02 12:30:03 +0200
commitccb0ca4493d8276c3a14b8c764c7fecc4fedc1fa (patch)
treef7de18a4b18d30bc3f48861ebb6520d3aa475d33 /libnm-util
parent3811a68389b9277533f2eee8372927ca6238653e (diff)
downloadNetworkManager-ccb0ca4493d8276c3a14b8c764c7fecc4fedc1fa.tar.gz
libnm-core,libnm-util: avoid calling a constructor
It yields completely unpredictable results on Ubuntu 12.04 (the global variable successfully comparing to NULL despite demonstrably not NULL). Possibly a toolchain bug.
Diffstat (limited to 'libnm-util')
-rw-r--r--libnm-util/nm-setting.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libnm-util/nm-setting.c b/libnm-util/nm-setting.c
index 105981bc34..35ae01daf8 100644
--- a/libnm-util/nm-setting.c
+++ b/libnm-util/nm-setting.c
@@ -99,7 +99,7 @@ _nm_gtype_hash (gconstpointer v)
return *((const GType *) v);
}
-static void __attribute__((constructor))
+static void
_ensure_registered (void)
{
if (G_UNLIKELY (registered_settings == NULL)) {
@@ -112,6 +112,12 @@ _ensure_registered (void)
}
}
+static void __attribute__((constructor))
+_ensure_registered_constructor (void)
+{
+ _ensure_registered ();
+}
+
#define _ensure_setting_info(self, priv) \
G_STMT_START { \
NMSettingPrivate *_priv_esi = (priv); \