summaryrefslogtreecommitdiff
path: root/libdm/libdm-config.c
diff options
context:
space:
mode:
Diffstat (limited to 'libdm/libdm-config.c')
-rw-r--r--libdm/libdm-config.c29
1 files changed, 18 insertions, 11 deletions
diff --git a/libdm/libdm-config.c b/libdm/libdm-config.c
index 8683b5a57..d9d3882f2 100644
--- a/libdm/libdm-config.c
+++ b/libdm/libdm-config.c
@@ -842,22 +842,29 @@ static int _find_config_bool(const void *start, node_lookup_fn find,
{
const struct dm_config_node *n = find(start, path);
const struct dm_config_value *v;
+ int b;
- if (!n)
- return fail;
+ if (n) {
+ v = n->v;
- v = n->v;
+ switch (v->type) {
+ case DM_CFG_INT:
+ b = v->v.i ? 1 : 0;
+ log_very_verbose("Setting %s to %d", path, b);
+ return b;
- switch (v->type) {
- case DM_CFG_INT:
- return v->v.i ? 1 : 0;
-
- case DM_CFG_STRING:
- return _str_to_bool(v->v.str, fail);
- default:
- ;
+ case DM_CFG_STRING:
+ b = _str_to_bool(v->v.str, fail);
+ log_very_verbose("Setting %s to %d", path, b);
+ return b;
+ default:
+ ;
+ }
}
+ log_very_verbose("%s not found in config: defaulting to %d",
+ path, fail);
+
return fail;
}