diff --git a/Tools/CCode/Source/Common/CommonLib.c b/Tools/CCode/Source/Common/CommonLib.c index 618abd89bb..4ae5542b8b 100644 --- a/Tools/CCode/Source/Common/CommonLib.c +++ b/Tools/CCode/Source/Common/CommonLib.c @@ -496,10 +496,10 @@ Returns: #ifdef __GNUC__ -size_t _filelength(FILE *file) +size_t _filelength(int fd) { struct stat stat_buf; - fstat(fileno(file), &stat_buf); + fstat(fd, &stat_buf); return stat_buf.st_size; } diff --git a/Tools/CCode/Source/Common/CommonLib.h b/Tools/CCode/Source/Common/CommonLib.h index f6c29ef8a8..40d35356e7 100644 --- a/Tools/CCode/Source/Common/CommonLib.h +++ b/Tools/CCode/Source/Common/CommonLib.h @@ -130,7 +130,7 @@ PrintGuidToBuffer ( #define _stricmp strcasecmp #define strnicmp strncasecmp #define strcmpi strcasecmp -size_t _filelength(FILE *file); +size_t _filelength(int fd); #ifndef __CYGWIN__ char *strlwr(char *s); #endif