mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-24 15:56:41 +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 */
|
/* insert an environment variable */
|
||||||
if (node.has_type("env")) try {
|
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 key = node.attribute("key");
|
||||||
Xml_attribute const value = node.attribute("value");
|
Xml_attribute const value = node.attribute("value");
|
||||||
|
|
||||||
@ -122,7 +129,9 @@ static void construct_component(Libc::Env &env)
|
|||||||
|
|
||||||
++env_i;
|
++env_i;
|
||||||
|
|
||||||
} catch (Xml_node::Nonexistent_sub_node) { }
|
}
|
||||||
|
catch (Xml_node::Nonexistent_sub_node) { }
|
||||||
|
catch (Xml_node::Nonexistent_attribute) { }
|
||||||
});
|
});
|
||||||
|
|
||||||
envp[env_i] = NULL;
|
envp[env_i] = NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user