]> git.pld-linux.org Git - packages/file.git/commitdiff
revert commit that closes STDIN
authorElan Ruusamäe <glen@delfi.ee>
Mon, 18 Apr 2016 16:48:52 +0000 (19:48 +0300)
committerElan Ruusamäe <glen@delfi.ee>
Mon, 18 Apr 2016 16:48:52 +0000 (19:48 +0300)
http://lists.pld-linux.org/mailman/pipermail/pld-devel-en/2016-April/024804.html

file.spec
revert-close.patch [new file with mode: 0644]

index 80e78a560774adb1c74f0c2f6c440c9661352914..7037547338a6ff024a156041b4662fe071d48050 100644 (file)
--- 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 (file)
index 0000000..ab72671
--- /dev/null
@@ -0,0 +1,19 @@
+commit c8581da4c79cfc3fe52bb6c398497ff3a9986abd
+Author: Christos Zoulas <christos@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);
This page took 0.050044 seconds and 4 git commands to generate.