mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-02 05:57:47 +00:00
close fd 0 and 1 where not required
the fd 0,1 and 2 are still inherited and we only need the fd 2 (stderr) after the start/restart of the application. Signed-off-by: Michel Normand <normand@fr.ibm.com> Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
This commit is contained in:
parent
698287d8cf
commit
affaa6da9d
@ -92,6 +92,10 @@ int main(int argc, char *argv[])
|
||||
exit(err);
|
||||
}
|
||||
|
||||
/* no need of other inherited fds but stderr */
|
||||
close(fileno(stdin));
|
||||
close(fileno(stdout));
|
||||
|
||||
err = 0;
|
||||
for (;;) {
|
||||
int status;
|
||||
|
@ -547,6 +547,10 @@ int lxc_start(const char *name, char *const argv[], struct lxc_conf *conf)
|
||||
goto out_fini;
|
||||
}
|
||||
|
||||
/* no need of other inherited fds but stderr */
|
||||
close(fileno(stdin));
|
||||
close(fileno(stdout));
|
||||
|
||||
err = lxc_poll(name, handler);
|
||||
if (err) {
|
||||
ERROR("mainloop exited with an error");
|
||||
|
Loading…
Reference in New Issue
Block a user