From fd2a88b190eb2bdfab1113af7211c058cb75cd67 Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Thu, 21 Feb 2019 00:12:15 +0100 Subject: [PATCH] attach: cleanup macros lxc_proc_close_ns_fd Signed-off-by: Christian Brauner --- src/lxc/attach.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/lxc/attach.c b/src/lxc/attach.c index 756ccfbcf..202b15d07 100644 --- a/src/lxc/attach.c +++ b/src/lxc/attach.c @@ -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]; } } -- 2.47.2