Apply upstream fix 11edb37a71851b5bcbd4e51ca6ad3dcbf57e9761:

Revert: Don't close stdin...
This commit is contained in:
Xin LI 2016-05-08 09:27:29 +00:00
parent 196a380938
commit 464d64c863

View File

@ -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);