mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-15 22:51:24 +00:00
start: refactor match_stdfds()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
parent
5e64d01b6c
commit
ec1dc63394
@ -208,9 +208,9 @@ static bool lxc_try_preserve_namespaces(struct lxc_handler *handler,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int match_fd(int fd)
|
static inline bool match_stdfds(int fd)
|
||||||
{
|
{
|
||||||
return (fd == 0 || fd == 1 || fd == 2);
|
return (fd == STDIN_FILENO || fd == STDOUT_FILENO || fd == STDERR_FILENO);
|
||||||
}
|
}
|
||||||
|
|
||||||
int lxc_check_inherited(struct lxc_conf *conf, bool closeall,
|
int lxc_check_inherited(struct lxc_conf *conf, bool closeall,
|
||||||
@ -277,7 +277,7 @@ restart:
|
|||||||
if (current_config && fd == current_config->logfd)
|
if (current_config && fd == current_config->logfd)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (match_fd(fd))
|
if (match_stdfds(fd))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (closeall) {
|
if (closeall) {
|
||||||
|
Loading…
Reference in New Issue
Block a user