]> granicus.if.org Git - file/commitdiff
doesn't matter if it is stdin; if we opened it, we close it.
authorChristos Zoulas <christos@zoulas.com>
Mon, 8 Feb 2016 02:20:36 +0000 (02:20 +0000)
committerChristos Zoulas <christos@zoulas.com>
Mon, 8 Feb 2016 02:20:36 +0000 (02:20 +0000)
src/magic.c

index 30faa8a002304a4c254938760a9da2508eea59cd..c3ceb50b652b72e93a04dc324df92e402b6d401d 100644 (file)
@@ -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);