Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include error message when loading config file fails #1310

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/udisksconfigmanager.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ parse_config_file (UDisksConfigManager *manager,
gchar *module_i;
gchar **modules;
gchar **modules_tmp;
GError *l_error = NULL;

/* Get modules and means of loading */
conf_filename = g_build_filename (G_DIR_SEPARATOR_S,
Expand All @@ -163,7 +164,7 @@ parse_config_file (UDisksConfigManager *manager,
/* Load config */
config_file = g_key_file_new ();
g_key_file_set_list_separator (config_file, ',');
if (g_key_file_load_from_file (config_file, conf_filename, G_KEY_FILE_NONE, NULL))
if (g_key_file_load_from_file (config_file, conf_filename, G_KEY_FILE_NONE, &l_error))
{
if (out_modules != NULL)
{
Expand Down Expand Up @@ -225,7 +226,16 @@ parse_config_file (UDisksConfigManager *manager,
}
else
{
udisks_warning ("Can't load configuration file %s", conf_filename);
if (l_error != NULL)
{
udisks_warning ("Can't load configuration file %s: %s", conf_filename, l_error->message);
g_error_free (l_error);
}
else
{
udisks_warning ("Can't load configuration file %s", conf_filename);
}

}

g_key_file_free (config_file);
Expand Down