Skip to content
Browse files

OS-1872 zoneadmd parent needs to close open fds

  • Loading branch information...
1 parent 8654c64 commit a73b96107921daae8c52291c5b60d9e954ba822b @jjelinek jjelinek committed Feb 7, 2013
Showing with 7 additions and 0 deletions.
  1. +7 −0 usr/src/cmd/zoneadmd/zoneadmd.c
View
7 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);

0 comments on commit a73b961

Please sign in to comment.
Something went wrong with that request. Please try again.