file: fix close_on_exec for multithreaded decompression

It is not safe to call the 'file' command from multiple threads. When a
file is checked with multiple threads in parallel, the file descriptors
might get shared which makes the pipe handling lock up, leading to lock
up in rpmbuild. And may lead to rarely deadlock on random recipes's
do_package task.

(From OE-Core rev: 167814b81ddac3934077b0ee91c0c6015fc02bfe)

Signed-off-by: Changqing Li <changqing.li@windriver.com>
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Changqing Li
2021-08-24 17:20:49 +08:00
committed by Richard Purdie
parent 0051bac30a
commit 0f966a0ce6
2 changed files with 222 additions and 1 deletions

View File

@@ -12,7 +12,8 @@ DEPENDS = "file-replacement-native"
DEPENDS_class-native = "bzip2-replacement-native"
SRC_URI = "git://github.com/file/file.git \
file://0001-src-compress.c-correct-header-define-for-xz-lzma.patch"
file://0001-src-compress.c-correct-header-define-for-xz-lzma.patch \
file://0001-Fix-close_on_exec-multithreaded-decompression-issue.patch"
SRCREV = "87731415de945660b00f02207d8e9d986ef9b82e"
S = "${WORKDIR}/git"