From: Daniel Wagner <[email protected]>

Which reflects the new usage of the hash much better.
---
 plugins/session_policy_local.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/plugins/session_policy_local.c b/plugins/session_policy_local.c
index d8ae222..3401e35 100644
--- a/plugins/session_policy_local.c
+++ b/plugins/session_policy_local.c
@@ -46,7 +46,7 @@
 
 static DBusConnection *connection;
 
-static GHashTable *policy_hash;
+static GHashTable *file_hash;
 static GHashTable *session_hash;
 static GSList *policy_list;
 
@@ -175,7 +175,7 @@ static void selinux_context_reply(int error,
                goto done;
        }
 
-       policy = g_hash_table_lookup(policy_hash, ident);
+       policy = g_hash_table_lookup(file_hash, ident);
        if (policy == NULL) {
                policy = create_policy();
                policy->ident = g_strdup(ident);
@@ -371,7 +371,7 @@ static void remove_policy(struct policy_data *policy)
        if (policy->session != NULL)
                update = TRUE;
 
-       g_hash_table_remove(policy_hash, policy->ident);
+       g_hash_table_remove(file_hash, policy->ident);
        policy_unref(policy);
 
        if (update == FALSE)
@@ -409,7 +409,7 @@ static void notify_handler(struct inotify_event *event,
        if (ident == NULL)
                return;
 
-       policy = g_hash_table_lookup(policy_hash, ident);
+       policy = g_hash_table_lookup(file_hash, ident);
 
        if (event->mask & (IN_CREATE | IN_MOVED_TO)) {
                connman_info("Policy added for '%s'", ident);
@@ -433,7 +433,7 @@ static void notify_handler(struct inotify_event *event,
                        return;
                }
 
-               g_hash_table_replace(policy_hash,
+               g_hash_table_replace(file_hash,
                                g_strdup(ident), policy);
        }
 
@@ -486,7 +486,7 @@ static void read_policies(void)
                                continue;
                        }
 
-                       g_hash_table_replace(policy_hash, g_strdup(file),
+                       g_hash_table_replace(file_hash, g_strdup(file),
                                                policy);
                }
 
@@ -514,7 +514,7 @@ static int session_policy_local_init(void)
 
        session_hash = g_hash_table_new_full(g_direct_hash, g_direct_equal,
                                                NULL, NULL);
-       policy_hash = g_hash_table_new_full(g_str_hash, g_str_equal,
+       file_hash = g_hash_table_new_full(g_str_hash, g_str_equal,
                                        g_free, NULL);
 
        err = connman_inotify_register(POLICYDIR, notify_handler);
@@ -536,8 +536,8 @@ err_notify:
 err:
        if (session_hash != NULL)
                g_hash_table_destroy(session_hash);
-       if (policy_hash != NULL)
-               g_hash_table_destroy(policy_hash);
+       if (file_hash != NULL)
+               g_hash_table_destroy(file_hash);
 
        connman_session_policy_unregister(&session_policy_local);
 
@@ -551,7 +551,7 @@ static void session_policy_local_exit(void)
        DBG("");
 
        g_hash_table_destroy(session_hash);
-       g_hash_table_destroy(policy_hash);
+       g_hash_table_destroy(file_hash);
 
        g_slist_free_full(policy_list, free_policy);
 
-- 
1.8.2.rc3.16.gce432ca

_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to