Commit 43d7093e authored by Jussi Kukkonen's avatar Jussi Kukkonen

better error handling for localnet

Also make sure the config dir exists (it doesn't on maemo)
parent 8e9d5eb2
......@@ -201,7 +201,7 @@ geoclue_localnet_load_gateways_from_keyfile (GeoclueLocalnet *localnet,
char **groups;
char **g;
GError *error;
GError *error = NULL;
groups = g_key_file_get_groups (keyfile, NULL);
g = groups;
......@@ -218,7 +218,7 @@ geoclue_localnet_load_gateways_from_keyfile (GeoclueLocalnet *localnet,
keys = g_key_file_get_keys (keyfile, *g,
NULL, &error);
if (error) {
g_warning ("Could not load keys for group %s from %s: %s",
g_warning ("Could not load keys for group [%s] from %s: %s",
*g, localnet->keyfile_name, error->message);
g_error_free (error);
error = NULL;
......@@ -282,12 +282,13 @@ geoclue_localnet_init (GeoclueLocalnet *localnet)
/* load known addresses from keyfile */
dir = g_get_user_config_dir ();
g_mkdir_with_parents (dir, 0755);
localnet->keyfile_name = g_build_filename (dir, KEYFILE_NAME, NULL);
keyfile = g_key_file_new ();
if (!g_key_file_load_from_file (keyfile, localnet->keyfile_name,
G_KEY_FILE_NONE, &error)) {
g_warning ("Error loading keyfile %s: %s",
g_warning ("Could not load keyfile %s: %s",
localnet->keyfile_name, error->message);
g_error_free (error);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment