summaryrefslogtreecommitdiff
path: root/src/polkitagent
diff options
context:
space:
mode:
authorDavid Zeuthen <davidz@redhat.com>2011-02-21 16:24:00 -0500
committerDavid Zeuthen <davidz@redhat.com>2011-02-21 16:24:00 -0500
commit5deb98a5d28e4a6e4c02b401112960c3ba262feb (patch)
treea9ad2f2a132c841b2131c0bec73430e98768546e /src/polkitagent
parentc6ab7b99cf2cc48445ca3ab601967f8a4d5bda02 (diff)
downloadpolkit-5deb98a5d28e4a6e4c02b401112960c3ba262feb.tar.gz
Always pass non-zero value to g_once_init_leave()
Signed-off-by: David Zeuthen <davidz@redhat.com>
Diffstat (limited to 'src/polkitagent')
-rw-r--r--src/polkitagent/polkitagentsession.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/polkitagent/polkitagentsession.c b/src/polkitagent/polkitagentsession.c
index 9861b5d..52fb020 100644
--- a/src/polkitagent/polkitagentsession.c
+++ b/src/polkitagent/polkitagentsession.c
@@ -63,14 +63,15 @@
static gboolean
_show_debug (void)
{
- static gsize show_debug = 0;
- if (g_once_init_enter (&show_debug))
+ static volatile gsize has_show_debug = 0;
+ static gboolean show_debug_value = FALSE;
+
+ if (g_once_init_enter (&has_show_debug))
{
- gsize v;
- v = g_getenv ("POLKIT_DEBUG") != NULL;
- g_once_init_leave (&show_debug, v);
+ show_debug_value = (g_getenv ("POLKIT_DEBUG") != NULL);
+ g_once_init_leave (&has_show_debug, 1);
}
- return show_debug;
+ return show_debug_value;
}
/**