From f2faa8fab9b15637582f7610e6b7b59261e58488 Mon Sep 17 00:00:00 2001 From: Michel Normand Date: Thu, 29 Apr 2010 10:03:59 +0200 Subject: [PATCH] add fd to ignore to lxc_check_inherited function Signed-off-by: Michel Normand Signed-off-by: Daniel Lezcano --- src/lxc/start.c | 6 +++--- src/lxc/start.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lxc/start.c b/src/lxc/start.c index cd2b237f8..57a28e87f 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -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); diff --git a/src/lxc/start.h b/src/lxc/start.h index 68be286d3..e69480a57 100644 --- a/src/lxc/start.h +++ b/src/lxc/start.h @@ -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 -- 2.47.2