main: do not open twice the same file

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano 2019-05-24 12:58:31 +02:00
parent a468981104
commit 6c74e33cca
No known key found for this signature in database
GPG Key ID: E4730F97F60286ED

4
main.c
View File

@ -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)
{