From: Christos Zoulas Date: Tue, 19 Apr 2016 20:51:54 +0000 (+0000) Subject: Revert: Don't close stdin... X-Git-Tag: FILE5_27~16 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=11edb37a71851b5bcbd4e51ca6ad3dcbf57e9761;p=file Revert: Don't close stdin... --- 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);