summaryrefslogtreecommitdiff
path: root/Tools/CCode
diff options
context:
space:
mode:
authorbbahnsen <bbahnsen@6f19259b-4bc3-4df7-8a09-765794883524>2006-11-29 21:03:11 +0000
committerbbahnsen <bbahnsen@6f19259b-4bc3-4df7-8a09-765794883524>2006-11-29 21:03:11 +0000
commit22982ae4a28e1dd96ab4a68a8ad96302df4e2dbb (patch)
treee705d0571c550a5d68ad54bd888075dab60e7365 /Tools/CCode
parentc4b01967dd369196fa7bad6e41af1c41ee0b62b1 (diff)
downloadedk2-22982ae4a28e1dd96ab4a68a8ad96302df4e2dbb.zip
edk2-22982ae4a28e1dd96ab4a68a8ad96302df4e2dbb.tar.gz
edk2-22982ae4a28e1dd96ab4a68a8ad96302df4e2dbb.tar.bz2
_filelength is a function of fd, not FILE *
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2038 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'Tools/CCode')
-rw-r--r--Tools/CCode/Source/Common/CommonLib.c4
-rw-r--r--Tools/CCode/Source/Common/CommonLib.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/Tools/CCode/Source/Common/CommonLib.c b/Tools/CCode/Source/Common/CommonLib.c
index 618abd8..4ae5542 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 f6c29ef..40d3535 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