From: Christos Zoulas Date: Tue, 19 Apr 2016 20:51:54 +0000 (+0000) Subject: Revert: Don't close stdin... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5602ff2a4adc6e4ffb26c3f144aa0a84bf09d170;p=file Revert: Don't close stdin... --- diff --git a/src/magic.c b/src/magic.c index 315a9442..8b7960b9 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.97 2016/03/31 17:51:12 christos Exp $") +FILE_RCSID("@(#)$File: magic.c,v 1.98 2016/04/19 20:51:54 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);