[libgnome-keyring] Don't use deprecated glib 2.36 stuff



commit 79c2751a7bee5b441c2819d8f559af1618a53e73
Author: Stef Walter <stefw gnome org>
Date:   Sat Apr 27 21:53:49 2013 +0200

    Don't use deprecated glib 2.36 stuff

 egg/egg-libgcrypt.c            |    3 +--
 egg/egg-secure-memory.h        |    6 +++---
 library/gnome-keyring-memory.c |    6 +++---
 3 files changed, 7 insertions(+), 8 deletions(-)
---
diff --git a/egg/egg-libgcrypt.c b/egg/egg-libgcrypt.c
index 07e7347..4d446f3 100644
--- a/egg/egg-libgcrypt.c
+++ b/egg/egg-libgcrypt.c
@@ -108,8 +108,7 @@ egg_libgcrypt_initialize (void)
 
                /* Only initialize libgcrypt if it hasn't already been initialized */
                if (!gcry_control (GCRYCTL_INITIALIZATION_FINISHED_P)) {
-                       if (g_thread_supported())
-                               gcry_control (GCRYCTL_SET_THREAD_CBS, &glib_thread_cbs);
+                       gcry_control (GCRYCTL_SET_THREAD_CBS, &glib_thread_cbs);
                        gcry_check_version (LIBGCRYPT_VERSION);
                        gcry_set_log_handler (log_handler, NULL);
                        gcry_set_outofcore_handler (no_mem_handler, NULL);
diff --git a/egg/egg-secure-memory.h b/egg/egg-secure-memory.h
index 969dbd7..5181551 100644
--- a/egg/egg-secure-memory.h
+++ b/egg/egg-secure-memory.h
@@ -57,11 +57,11 @@ typedef struct {
                lock, unlock, fallback, NULL, EGG_SECURE_POOL_VER_STR };
 
 #define EGG_SECURE_DEFINE_GLIB_GLOBALS() \
-       static GStaticMutex memory_mutex = G_STATIC_MUTEX_INIT; \
+       static GMutex memory_mutex = { 0, }; \
        static void egg_memory_lock (void) \
-               { g_static_mutex_lock (&memory_mutex); } \
+               { g_mutex_lock (&memory_mutex); } \
        static void egg_memory_unlock (void) \
-               { g_static_mutex_unlock (&memory_mutex); } \
+               { g_mutex_unlock (&memory_mutex); } \
        EGG_SECURE_DEFINE_GLOBALS (egg_memory_lock, egg_memory_unlock, g_realloc);
 
 extern egg_secure_glob EGG_SECURE_GLOBALS;
diff --git a/library/gnome-keyring-memory.c b/library/gnome-keyring-memory.c
index 96d1158..3ba85cb 100644
--- a/library/gnome-keyring-memory.c
+++ b/library/gnome-keyring-memory.c
@@ -48,7 +48,7 @@
  * sensitive information.
  */
 
-static GStaticMutex memory_mutex = G_STATIC_MUTEX_INIT;
+static GMutex memory_mutex = { 0, };
 
 #define WARNING  "couldn't allocate secure memory to keep passwords " \
                  "and or keys from being written to the disk"
@@ -65,13 +65,13 @@ static GStaticMutex memory_mutex = G_STATIC_MUTEX_INIT;
 static void
 egg_memory_lock (void)
 {
-       g_static_mutex_lock (&memory_mutex);
+       g_mutex_lock (&memory_mutex);
 }
 
 static void
 egg_memory_unlock (void)
 {
-       g_static_mutex_unlock (&memory_mutex);
+       g_mutex_unlock (&memory_mutex);
 }
 
 static void *


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]