Commit f2faa8fa by Michel Normand Committed by Daniel Lezcano

add fd to ignore to lxc_check_inherited function

parent 4d2e2ec6
......@@ -113,7 +113,7 @@ static int match_fd(int fd)
return (fd == 0 || fd == 1 || fd == 2);
}
int lxc_check_inherited(void)
int lxc_check_inherited(int fd_to_ignore)
{
struct dirent dirent, *direntp;
int fd, fddir;
......@@ -143,7 +143,7 @@ int lxc_check_inherited(void)
fd = atoi(direntp->d_name);
if (fd == fddir || fd == lxc_log_fd)
if (fd == fddir || fd == lxc_log_fd || fd == fd_to_ignore)
continue;
if (match_fd(fd))
......@@ -535,7 +535,7 @@ int lxc_start(const char *name, char *const argv[], struct lxc_conf *conf)
int err = -1;
int status;
if (lxc_check_inherited())
if (lxc_check_inherited(-1))
return -1;
handler = lxc_init(name, conf);
......
......@@ -46,7 +46,7 @@ extern int lxc_poll(const char *name, struct lxc_handler *handler);
extern void lxc_abort(const char *name, struct lxc_handler *handler);
extern void lxc_fini(const char *name, struct lxc_handler *handler);
extern int lxc_set_state(const char *, struct lxc_handler *, lxc_state_t);
extern int lxc_check_inherited(void);
extern int lxc_check_inherited(int fd_to_ignore);
#endif
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