PolicyKit: Branch 'master'

David Zeuthen david at kemper.freedesktop.org
Mon Feb 21 13:24:23 PST 2011


 src/polkitagent/polkitagentsession.c |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

New commits:
commit 5deb98a5d28e4a6e4c02b401112960c3ba262feb
Author: David Zeuthen <davidz at redhat.com>
Date:   Mon Feb 21 16:24:00 2011 -0500

    Always pass non-zero value to g_once_init_leave()
    
    Signed-off-by: David Zeuthen <davidz at redhat.com>

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;
 }
 
 /**


More information about the hal-commit mailing list