From: Christian Brauner Date: Wed, 20 Feb 2019 23:12:15 +0000 (+0100) Subject: attach: cleanup macros lxc_proc_close_ns_fd X-Git-Tag: lxc-3.2.0~132^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fd2a88b190eb;p=thirdparty%2Flxc.git attach: cleanup macros lxc_proc_close_ns_fd Signed-off-by: Christian Brauner --- 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]; } }