[packages/file] revert commit that closes STDIN

glen glen at pld-linux.org
Mon Apr 18 18:49:25 CEST 2016


commit 0177f6dd30e1f8c5639c058dcdf1d9edd9f8528c
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Mon Apr 18 19:48:52 2016 +0300

    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(+)
---
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 <christos at zoulas.com>
+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);
+ 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/file.git/commitdiff/0177f6dd30e1f8c5639c058dcdf1d9edd9f8528c



More information about the pld-cvs-commit mailing list