mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-24 07:46:42 +00:00
posix: improve config error diagnostics
This commit is contained in:
parent
3c6fe6e741
commit
817ff6ca68
@ -82,6 +82,13 @@ static void construct_component(Libc::Env &env)
|
||||
/* insert an environment variable */
|
||||
if (node.has_type("env")) try {
|
||||
|
||||
auto check_attr = [] (Xml_node node, auto key) {
|
||||
if (!node.has_attribute(key))
|
||||
Genode::warning("<env> node lacks '", key, "' attribute"); };
|
||||
|
||||
check_attr(node, "key");
|
||||
check_attr(node, "value");
|
||||
|
||||
Xml_attribute const key = node.attribute("key");
|
||||
Xml_attribute const value = node.attribute("value");
|
||||
|
||||
@ -122,7 +129,9 @@ static void construct_component(Libc::Env &env)
|
||||
|
||||
++env_i;
|
||||
|
||||
} catch (Xml_node::Nonexistent_sub_node) { }
|
||||
}
|
||||
catch (Xml_node::Nonexistent_sub_node) { }
|
||||
catch (Xml_node::Nonexistent_attribute) { }
|
||||
});
|
||||
|
||||
envp[env_i] = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user