Commit 3603af1b by Vincent Giersch Committed by Stéphane Graber

Fix a file descriptor leak in the monitord spawn

parent 9581b4b7
...@@ -319,6 +319,7 @@ int lxc_monitord_spawn(const char *lxcpath) ...@@ -319,6 +319,7 @@ int lxc_monitord_spawn(const char *lxcpath)
SYSERROR("failed to setsid"); SYSERROR("failed to setsid");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
lxc_check_inherited(NULL, pipefd[1]);
close(0); close(0);
close(1); close(1);
close(2); close(2);
......
...@@ -203,7 +203,7 @@ restart: ...@@ -203,7 +203,7 @@ restart:
if (match_fd(fd)) if (match_fd(fd))
continue; continue;
if (conf->close_all_fds) { if (conf == NULL || conf->close_all_fds) {
close(fd); close(fd);
closedir(dir); closedir(dir);
INFO("closed inherited fd %d", fd); INFO("closed inherited fd %d", fd);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment