Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
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;
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))
int err = -1;
int status;
- if (lxc_check_inherited())
+ if (lxc_check_inherited(-1))
return -1;
handler = lxc_init(name, conf);
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