From c8581da4c79cfc3fe52bb6c398497ff3a9986abd Mon Sep 17 00:00:00 2001 From: Christos Zoulas Date: Mon, 8 Feb 2016 02:20:36 +0000 Subject: [PATCH] doesn't matter if it is stdin; if we opened it, we close it. --- src/magic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/magic.c b/src/magic.c index 30faa8a0..c3ceb50b 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.94 2015/07/11 14:41:37 christos Exp $") +FILE_RCSID("@(#)$File: magic.c,v 1.95 2015/09/11 17:24:09 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 (fd == STDIN_FILENO || name == NULL) + if (name == NULL) return; (void) close(fd); -- 2.40.0