diff options
| author | Jerry Jelinek <jerry.jelinek@joyent.com> | 2013-02-07 14:10:12 +0000 |
|---|---|---|
| committer | Robert Mustacchi <rm@joyent.com> | 2015-10-24 19:06:56 -0700 |
| commit | 056d3a7d553516b590a0543f4df3152a3144b42b (patch) | |
| tree | 63aecdbaefcd4ec227fabdd1c24ba3904aeec7d8 /usr/src | |
| parent | 78b013d7a408ae8e9eacdb67cae24fc8ecab1ebf (diff) | |
| download | illumos-joyent-056d3a7d553516b590a0543f4df3152a3144b42b.tar.gz | |
6343 zoneadmd parent needs to close open fds
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Gordon Ross <gordon.ross@nexenta.com>
Approved by: Garrett D'Amore <garrett@damore.org>
Diffstat (limited to 'usr/src')
| -rw-r--r-- | usr/src/cmd/zoneadmd/zoneadmd.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/usr/src/cmd/zoneadmd/zoneadmd.c b/usr/src/cmd/zoneadmd/zoneadmd.c index cb81b77727..e2bbd20640 100644 --- a/usr/src/cmd/zoneadmd/zoneadmd.c +++ b/usr/src/cmd/zoneadmd/zoneadmd.c @@ -2052,6 +2052,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); |
