From: Christian Brauner Date: Fri, 22 Feb 2019 20:56:55 +0000 (+0100) Subject: conf: cleanup macros lxc_chroot X-Git-Tag: lxc-3.2.0~131^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4fdd1f72513d3455e8d6ce3b67c71814df12de47;p=thirdparty%2Flxc.git conf: cleanup macros lxc_chroot Signed-off-by: Christian Brauner --- diff --git a/src/lxc/conf.c b/src/lxc/conf.c index 5385e3285..eba476dc2 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -1349,7 +1349,6 @@ int lxc_chroot(const struct lxc_rootfs *rootfs) int i, ret; char *p, *p2; char buf[LXC_LINELEN]; - FILE *f; char *root = rootfs->mount; nroot = realpath(root, NULL); @@ -1388,6 +1387,7 @@ int lxc_chroot(const struct lxc_rootfs *rootfs) * inherited mounts are locked and we should live with all this trash. */ for (;;) { + __do_fclose FILE *f = NULL; int progress = 0; f = fopen("./proc/self/mountinfo", "r"); @@ -1421,8 +1421,6 @@ int lxc_chroot(const struct lxc_rootfs *rootfs) progress++; } - fclose(f); - if (!progress) break; }