]> git.proxmox.com Git - mirror_lxc.git/commit - src/lxc/lxc_start.c
fix closed fd when they are inherited
authorDaniel Lezcano <dlezcano@fr.ibm.com>
Mon, 20 Jul 2009 15:57:31 +0000 (17:57 +0200)
committerDaniel Lezcano <dlezcano@fr.ibm.com>
Mon, 20 Jul 2009 15:57:31 +0000 (17:57 +0200)
commitaf795875875de1855ee251ba530fbe2b53463f6e
tree8cf37b32ce618de6708b9f39e71d5265df9e0515
parent0dd4566ecadfa4a42529250513dc68b6aed4ce92
fix closed fd when they are inherited

This patch fix a problem with the commit d983b93c3ad860fa22ef760ae27a944d6000e35a
When the lxc daemonize, it closes fd 0, 1 and 2. But these ones are coming from
inherited fd and they are already in the inherited list of fd. When lxc creates
some file descriptors, they have the number of the previous inherited file
descriptor, so they are closed when we close all the inherited file descriptors.

In order to fix that, the lxc_close_inherited_fd function has been implemented
to close an inherited fd and remove it from the list.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
src/lxc/lxc_start.c
src/lxc/start.c
src/lxc/utils.c
src/lxc/utils.h