Skip to content

Commit

Permalink
OS-1872 zoneadmd parent needs to close open fds
Browse files Browse the repository at this point in the history
  • Loading branch information
jjelinek committed Feb 7, 2013
1 parent 8654c64 commit a73b961
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions usr/src/cmd/zoneadmd/zoneadmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit a73b961

Please sign in to comment.