libc: do not open stdio descriptors unless configured to do so

Fix #2396
This commit is contained in:
Emery Hemingway 2017-04-13 10:53:47 -05:00 committed by Christian Helmuth
parent 24a9537a27
commit 01e8f7ea3d

View File

@ -82,6 +82,7 @@ class Libc::Vfs_plugin : public Libc::Plugin
if (_root_dir.num_dirent("/"))
env.config([&] (Xml_node const &top) {
try {
Xml_node const node = top.sub_node("libc");
try {
@ -93,6 +94,7 @@ class Libc::Vfs_plugin : public Libc::Plugin
_open_stdio(node, "stdin", 0, O_RDONLY);
_open_stdio(node, "stdout", 1, O_WRONLY);
_open_stdio(node, "stderr", 2, O_WRONLY);
} catch (Xml_node::Nonexistent_sub_node) { }
});
}