summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2013-07-08 21:40:14 +0200
committerJohn Crispin <blogic@openwrt.org>2013-07-08 21:40:14 +0200
commit8643c5876241474be551980e51740f2dcb8046bd (patch)
treee02e6cbf365a3fa64396e3d39c3679aed21dd109
parent9f8c266ba9a7232710b492974750cdbf0edf0bfe (diff)
downloadunitd-8643c5876241474be551980e51740f2dcb8046bd.tar
unitd-8643c5876241474be551980e51740f2dcb8046bd.zip
close stdin/out/err before forking an instance
Signed-off-by: John Crispin <blogic@openwrt.org>
-rw-r--r--instance.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/instance.c b/instance.c
index b5ecad0..28e5c94 100644
--- a/instance.c
+++ b/instance.c
@@ -81,6 +81,9 @@ instance_run(struct service_instance *in)
argv[argc++] = blobmsg_data(cur);
argv[argc] = NULL;
+ close(STDIN_FILENO);
+ close(STDOUT_FILENO);
+ close(STDERR_FILENO);
execvp(argv[0], argv);
exit(127);
}