From 11edb37a71851b5bcbd4e51ca6ad3dcbf57e9761 Mon Sep 17 00:00:00 2001 From: Christos Zoulas Date: Tue, 19 Apr 2016 20:51:54 +0000 Subject: [PATCH] Revert: Don't close stdin... --- src/magic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/magic.c b/src/magic.c index 46e46784..8cf62694 100644 --- a/src/magic.c +++ b/src/magic.c @@ -33,7 +33,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: magic.c,v 1.96 2016/02/08 02:20:36 christos Exp $") +FILE_RCSID("@(#)$File: magic.c,v 1.97 2016/03/31 17:51:12 christos Exp $") #endif /* lint */ #include "magic.h" @@ -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); -- 2.40.0