aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2016-05-08 09:27:29 +0000
committerXin LI <delphij@FreeBSD.org>2016-05-08 09:27:29 +0000
commit464d64c86332c83ead63f01362597b5da9bd8e82 (patch)
tree20d41b68a6683e2527c71bf10d43c8b6c66c0eed
parent196a380938cafa8bcc6ffcfd739c093a8673c712 (diff)
downloadsrc-464d64c86332c83ead63f01362597b5da9bd8e82.tar.gz
src-464d64c86332c83ead63f01362597b5da9bd8e82.zip
Apply upstream fix 11edb37a71851b5bcbd4e51ca6ad3dcbf57e9761:
Revert: Don't close stdin...
Notes
Notes: svn path=/vendor/file/dist/; revision=299233
-rw-r--r--src/magic.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/magic.c b/src/magic.c
index 315a94420c4a..8cf62694383d 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 (name == NULL)
+ if (fd == STDIN_FILENO || name == NULL)
return;
(void) close(fd);