]> granicus.if.org Git - file/commitdiff
move a compat fallback for stdin fileno earlier. both this and the previous
authorChristos Zoulas <christos@zoulas.com>
Mon, 17 Oct 2005 15:14:44 +0000 (15:14 +0000)
committerChristos Zoulas <christos@zoulas.com>
Mon, 17 Oct 2005 15:14:44 +0000 (15:14 +0000)
fix are from: Arkadiusz Miskiewicz <arekm@pld-linux.org>

src/magic.c

index ab4ac73edb6f1333afc011b160e461a4dc752874..66a6302bb3dfe702acdccd16b7dfa53b896c3049 100644 (file)
@@ -63,7 +63,7 @@
 #include "patchlevel.h"
 
 #ifndef        lint
-FILE_RCSID("@(#)$Id: magic.c,v 1.30 2005/10/17 15:13:31 christos Exp $")
+FILE_RCSID("@(#)$Id: magic.c,v 1.31 2005/10/17 15:14:44 christos Exp $")
 #endif /* lint */
 
 #ifdef __EMX__
@@ -76,6 +76,10 @@ private void free_mlist(struct mlist *);
 private void close_and_restore(const struct magic_set *, const char *, int,
     const struct stat *);
 
+#ifndef        STDIN_FILENO
+#define        STDIN_FILENO    0
+#endif
+
 public struct magic_set *
 magic_open(int flags)
 {
@@ -240,9 +244,6 @@ magic_file(struct magic_set *ms, const char *inname)
                goto done;
        }
 
-#ifndef        STDIN_FILENO
-#define        STDIN_FILENO    0
-#endif
        if (inname == NULL)
                fd = STDIN_FILENO;
        else if ((fd = open(inname, O_RDONLY)) < 0) {