From 0177f6dd30e1f8c5639c058dcdf1d9edd9f8528c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Elan=20Ruusam=C3=A4e?= Date: Mon, 18 Apr 2016 19:48:52 +0300 Subject: [PATCH] revert commit that closes STDIN http://lists.pld-linux.org/mailman/pipermail/pld-devel-en/2016-April/024804.html --- file.spec | 2 ++ revert-close.patch | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 revert-close.patch diff --git a/file.spec b/file.spec index 80e78a5..7037547 100644 --- a/file.spec +++ b/file.spec @@ -45,6 +45,7 @@ Patch1: searchpath.patch Patch2: automake.patch Patch4: name-use-count.patch Patch5: 001949.patch +Patch6: revert-close.patch URL: http://www.darwinsys.com/file/ BuildRequires: autoconf >= 2.50 BuildRequires: automake @@ -272,6 +273,7 @@ Wiązania Pythona 3 do biblioteki libmagic. %patch2 -p1 %patch4 -p1 %patch5 -p0 -d magic/Magdir +%patch6 -p1 -R %if "%{cc_version}" < "3.4" %{__sed} -i -e 's,-Wextra,,' configure.ac diff --git a/revert-close.patch b/revert-close.patch new file mode 100644 index 0000000..ab72671 --- /dev/null +++ b/revert-close.patch @@ -0,0 +1,19 @@ +commit c8581da4c79cfc3fe52bb6c398497ff3a9986abd +Author: Christos Zoulas +Date: Mon Feb 8 02:20:36 2016 +0000 + + doesn't matter if it is stdin; if we opened it, we close it. + +diff --git a/src/magic.c b/src/magic.c +index 30faa8a..c3ceb50 100644 +--- a/src/magic.c ++++ b/src/magic.c +@@ -346,7 +346,7 @@ private void + close_and_restore(const struct magic_set *ms, const char *name, int fd, + const struct stat *sb) + { +- if (fd == STDIN_FILENO || name == NULL) ++ if (name == NULL) + return; + (void) close(fd); + -- 2.44.0