]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
attach: cleanup macros lxc_proc_close_ns_fd
authorChristian Brauner <christian.brauner@ubuntu.com>
Wed, 20 Feb 2019 23:12:15 +0000 (00:12 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Wed, 20 Feb 2019 23:19:21 +0000 (00:19 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/attach.c

index 756ccfbcfed2f4c151cbd236df9386620188abf6..202b15d07e88d4004afa43c449184bc65d227195 100644 (file)
@@ -125,14 +125,8 @@ static struct lxc_proc_context_info *lxc_proc_get_context_info(pid_t pid)
 
 static inline void lxc_proc_close_ns_fd(struct lxc_proc_context_info *ctx)
 {
-       int i;
-
-       for (i = 0; i < LXC_NS_MAX; i++) {
-               if (ctx->ns_fd[i] < 0)
-                       continue;
-
-               close(ctx->ns_fd[i]);
-               ctx->ns_fd[i] = -EBADF;
+       for (int i = 0; i < LXC_NS_MAX; i++) {
+               __do_close_prot_errno int fd = ctx->ns_fd[i];
        }
 }