summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2013-02-07 14:10:12 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2013-02-07 14:10:12 +0000
commita73b96107921daae8c52291c5b60d9e954ba822b (patch)
treec2676f0cf02b2d1eef33fcf6fa2b828a4bc03d6f
parent8654c64ec01d3cce4bf75e996ff692c1c7586dcc (diff)
downloadillumos-joyent-release-20130207.tar.gz
OS-1872 zoneadmd parent needs to close open fds20130207release-20130207
-rw-r--r--usr/src/cmd/zoneadmd/zoneadmd.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/usr/src/cmd/zoneadmd/zoneadmd.c b/usr/src/cmd/zoneadmd/zoneadmd.c
index 4084d705a2..91c6f1764b 100644
--- a/usr/src/cmd/zoneadmd/zoneadmd.c
+++ b/usr/src/cmd/zoneadmd/zoneadmd.c
@@ -2200,6 +2200,13 @@ main(int argc, char *argv[])
(void) sigaddset(&block_cld, SIGCHLD);
(void) sigprocmask(SIG_BLOCK, &block_cld, NULL);
+ /*
+ * The parent only needs stderr after the fork, so close other fd's
+ * that we inherited from zoneadm so that the parent doesn't have those
+ * open while waiting. The child will close the rest after the fork.
+ */
+ closefrom(3);
+
if ((ctfd = init_template()) == -1) {
zerror(zlogp, B_TRUE, "failed to create contract");
return (1);