]> git.proxmox.com Git - mirror_lxc.git/commitdiff
start: refactor match_stdfds()
authorChristian Brauner <christian.brauner@ubuntu.com>
Thu, 5 Jul 2018 23:10:13 +0000 (01:10 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Fri, 6 Jul 2018 11:07:35 +0000 (13:07 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/start.c

index 953722261f45225e2c483368e510baf3d7d000a0..a13b56d9cbbf27a25f8851d16b80858a0ecc1bcd 100644 (file)
@@ -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) {