b445f2
From 38c03ddb18e86c84d89af695f72442d8365eb64e Mon Sep 17 00:00:00 2001
b445f2
From: Florian Festi <ffesti@redhat.com>
b445f2
Date: Tue, 21 Jul 2020 10:45:20 +0200
b445f2
Subject: [PATCH] Always close libelf handle (#1313)
b445f2
b445f2
Otherwise executables that are not proper elf files are leaking libelf
b445f2
handles. This results in file being left open (mmap'ed) and fails the
b445f2
build on NFS as those files can't be deleted properly there.
b445f2
b445f2
Resolves: rhbz#1840728
b445f2
See also: https://bugzilla.redhat.com/show_bug.cgi?id=1840728
b445f2
---
b445f2
 build/files.c | 2 +-
b445f2
 1 file changed, 1 insertion(+), 1 deletion(-)
b445f2
b445f2
diff --git a/build/files.c b/build/files.c
b445f2
index f675306f7..62489c07c 100644
b445f2
--- a/build/files.c
b445f2
+++ b/build/files.c
b445f2
@@ -1935,8 +1935,8 @@ static int generateBuildIDs(FileList fl, ARGV_t *files)
b445f2
 			if (terminate)
b445f2
 			    rc = 1;
b445f2
 		    }
b445f2
-		    elf_end (elf);
b445f2
 		}
b445f2
+		elf_end (elf);
b445f2
 		close (fd);
b445f2
 	    }
b445f2
 	}
b445f2
-- 
b445f2
2.26.2
b445f2