From: Christos Zoulas Date: Mon, 17 Oct 2005 15:14:44 +0000 (+0000) Subject: move a compat fallback for stdin fileno earlier. both this and the previous X-Git-Tag: FILE4_16~10 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6eeeb80dbb16d3700fecc78fa226953367d4229f;p=file move a compat fallback for stdin fileno earlier. both this and the previous fix are from: Arkadiusz Miskiewicz --- diff --git a/src/magic.c b/src/magic.c index ab4ac73e..66a6302b 100644 --- a/src/magic.c +++ b/src/magic.c @@ -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) {