summaryrefslogtreecommitdiff
path: root/src/storage.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2008-12-05 21:52:06 +0100
committerMarcel Holtmann <marcel@holtmann.org>2008-12-05 21:52:06 +0100
commitd58d6a1fc8aea4ac47f815d3217e3f6a19be378a (patch)
treec586850dd9f174d7e46806a2adbac12a69387062 /src/storage.c
parentfca9b70ed3be7b479c5949bf001d0a071802fca2 (diff)
downloadconnman-d58d6a1fc8aea4ac47f815d3217e3f6a19be378a.tar.gz
connman-d58d6a1fc8aea4ac47f815d3217e3f6a19be378a.tar.bz2
connman-d58d6a1fc8aea4ac47f815d3217e3f6a19be378a.zip
Load policy configuration from storage
Diffstat (limited to 'src/storage.c')
-rw-r--r--src/storage.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/storage.c b/src/storage.c
index 1aeda881..d8c32f4e 100644
--- a/src/storage.c
+++ b/src/storage.c
@@ -44,6 +44,11 @@ static int do_load(GKeyFile *keyfile, struct connman_element *element)
DBG("element %p name %s", element, element->name);
value = g_key_file_get_string(keyfile, element->path,
+ "Policy", NULL);
+ if (value != NULL)
+ element->policy = __connman_element_string2policy(value);
+
+ value = g_key_file_get_string(keyfile, element->path,
"WiFi.Security", NULL);
if (value != NULL)
connman_element_set_property(element,
@@ -98,14 +103,15 @@ static void do_update(GKeyFile *keyfile, struct connman_element *element)
{
GSList *list;
char *value;
+ const char *str;
DBG("element %p name %s", element, element->name);
g_key_file_set_string(keyfile, element->path, "Name", element->name);
- value = __connman_element_policy2string(element->policy);
- if (value != NULL)
- g_key_file_set_string(keyfile, element->path, "Policy", value);
+ str = __connman_element_policy2string(element->policy);
+ if (str != NULL)
+ g_key_file_set_string(keyfile, element->path, "Policy", str);
g_key_file_set_boolean(keyfile, element->path, "Enabled",
element->enabled);