summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorDaniel Wagner <daniel.wagner@bmw-carit.de>2012-12-05 11:44:59 +0200
committerPatrik Flykt <patrik.flykt@linux.intel.com>2012-12-05 12:47:48 +0200
commitc4b7e443238e371cf4a13f0ebcde44b8161655ce (patch)
treeccacfe7529e51ae6a098ab7c22347a25713836e8 /plugins
parentcb523a7775ed1b5f116e738711c27b623f347531 (diff)
downloadconnman-c4b7e443238e371cf4a13f0ebcde44b8161655ce.tar.gz
connman-c4b7e443238e371cf4a13f0ebcde44b8161655ce.tar.bz2
connman-c4b7e443238e371cf4a13f0ebcde44b8161655ce.zip
session_policy_local: Rename session_policy_ivi
On popular request the plugin is renamed. The plugin is reading local files and has nothing to do with IVI.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/session_policy_local.c (renamed from plugins/session_policy_ivi.c)54
1 files changed, 27 insertions, 27 deletions
diff --git a/plugins/session_policy_ivi.c b/plugins/session_policy_local.c
index a652964b..7fa3166a 100644
--- a/plugins/session_policy_ivi.c
+++ b/plugins/session_policy_local.c
@@ -38,7 +38,7 @@
#include <connman/dbus.h>
#include <connman/inotify.h>
-#define POLICYDIR STORAGEDIR "/session_policy_ivi"
+#define POLICYDIR STORAGEDIR "/session_policy_local"
static DBusConnection *connection;
@@ -198,7 +198,7 @@ done:
g_free(ident);
}
-static int policy_ivi_create(struct connman_session *session,
+static int policy_local_create(struct connman_session *session,
connman_session_config_cb callback,
void *user_data)
{
@@ -230,7 +230,7 @@ static int policy_ivi_create(struct connman_session *session,
return 0;
}
-static void policy_ivi_destroy(struct connman_session *session)
+static void policy_local_destroy(struct connman_session *session)
{
struct policy_data *policy;
@@ -243,11 +243,11 @@ static void policy_ivi_destroy(struct connman_session *session)
policy_unref(policy);
}
-static struct connman_session_policy session_policy_ivi = {
- .name = "session ivi policy configuration",
+static struct connman_session_policy session_policy_local = {
+ .name = "session local policy configuration",
.priority = CONNMAN_SESSION_POLICY_PRIORITY_DEFAULT,
- .create = policy_ivi_create,
- .destroy = policy_ivi_destroy,
+ .create = policy_local_create,
+ .destroy = policy_local_destroy,
};
static int load_keyfile(const char *pathname, GKeyFile **keyfile)
@@ -460,24 +460,14 @@ static int read_policies(void)
return err;
}
-static int session_policy_ivi_init(void)
+static int session_policy_local_init(void)
{
int err;
- err = connman_inotify_register(POLICYDIR, notify_handler);
- if (err < 0)
- return err;
-
connection = connman_dbus_get_connection();
if (connection == NULL)
return -EIO;
- err = connman_session_policy_register(&session_policy_ivi);
- if (err < 0) {
- dbus_connection_unref(connection);
- return err;
- }
-
session_hash = g_hash_table_new_full(g_direct_hash, g_direct_equal,
NULL, NULL);
if (session_hash == NULL) {
@@ -492,40 +482,50 @@ static int session_policy_ivi_init(void)
goto err;
}
- err = read_policies();
+ err = connman_inotify_register(POLICYDIR, notify_handler);
if (err < 0)
goto err;
+ err = read_policies();
+ if (err < 0)
+ goto err_notify;
+
+ err = connman_session_policy_register(&session_policy_local);
+ if (err < 0)
+ goto err_notify;
+
return 0;
+err_notify:
+
+ connman_inotify_unregister(POLICYDIR, notify_handler);
+
err:
if (session_hash != NULL)
g_hash_table_destroy(session_hash);
if (policy_hash != NULL)
g_hash_table_destroy(policy_hash);
- connman_session_policy_unregister(&session_policy_ivi);
+ connman_session_policy_unregister(&session_policy_local);
dbus_connection_unref(connection);
- connman_inotify_unregister(POLICYDIR, notify_handler);
-
return err;
}
-static void session_policy_ivi_exit(void)
+static void session_policy_local_exit(void)
{
g_hash_table_destroy(session_hash);
g_hash_table_destroy(policy_hash);
- connman_session_policy_unregister(&session_policy_ivi);
+ connman_session_policy_unregister(&session_policy_local);
dbus_connection_unref(connection);
connman_inotify_unregister(POLICYDIR, notify_handler);
}
-CONNMAN_PLUGIN_DEFINE(session_policy_ivi,
- "Session IVI policy configuration plugin",
+CONNMAN_PLUGIN_DEFINE(session_policy_local,
+ "Session local file policy configuration plugin",
VERSION, CONNMAN_PLUGIN_PRIORITY_DEFAULT,
- session_policy_ivi_init, session_policy_ivi_exit)
+ session_policy_local_init, session_policy_local_exit)