From ec1dc633944469682a63148940acca0ea79e86c4 Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Fri, 6 Jul 2018 01:10:13 +0200 Subject: [PATCH] start: refactor match_stdfds() Signed-off-by: Christian Brauner --- src/lxc/start.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lxc/start.c b/src/lxc/start.c index 953722261..a13b56d9c 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -208,9 +208,9 @@ static bool lxc_try_preserve_namespaces(struct lxc_handler *handler, 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, @@ -277,7 +277,7 @@ restart: if (current_config && fd == current_config->logfd) continue; - if (match_fd(fd)) + if (match_stdfds(fd)) continue; if (closeall) { -- 2.47.2