summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2020-10-06 20:19:31 +0200
committerJo-Philipp Wich <jo@mein.io>2020-10-06 20:19:31 +0200
commit745019d1ed6619f8123e1f11bf3761ff4fb93f4f (patch)
treecf95e3f0a13ae8c1f2f19cdf61e26601c77ae3f4
parentc874751224237aaed7509960d14823d9c06e6eb5 (diff)
fs: add stdio handles
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r--lib/fs.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/fs.c b/lib/fs.c
index 448ad62..9e15111 100644
--- a/lib/fs.c
+++ b/lib/fs.c
@@ -734,4 +734,8 @@ void ut_module_init(const struct ut_ops *ut, struct ut_state *s, struct json_obj
ops->register_type("fs.proc", proc_proto, close_proc);
ops->register_type("fs.file", file_proto, close_file);
ops->register_type("fs.dir", dir_proto, close_dir);
+
+ json_object_object_add(scope, "stdin", ops->set_type(xjs_new_object(), "fs.file", stdin));
+ json_object_object_add(scope, "stdout", ops->set_type(xjs_new_object(), "fs.file", stdout));
+ json_object_object_add(scope, "stderr", ops->set_type(xjs_new_object(), "fs.file", stderr));
}