From 6c74e33ccadfbfcc1a97efc553f8660001adb1b7 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Fri, 24 May 2019 12:58:31 +0200 Subject: [PATCH] main: do not open twice the same file Signed-off-by: Giuseppe Scrivano --- main.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/main.c b/main.c index 0aff6d8..989d7f4 100644 --- a/main.c +++ b/main.c @@ -949,10 +949,6 @@ make_ovl_node (const char *path, struct ovl_layer *layer, const char *name, ino_ if (fstat (fd, &st) == 0) ret->ino = st.st_ino; - close (fd); - fd = TEMP_FAILURE_RETRY (openat (it->fd, path, O_RDONLY|O_NONBLOCK|O_NOFOLLOW)); - if (fd < 0) - continue; s = safe_read_xattr (&val, fd, PRIVILEGED_ORIGIN_XATTR, PATH_MAX); if (s > 0) {