diff options
Diffstat (limited to 'sys/contrib/dev/acpica/compiler/prutils.c')
-rw-r--r-- | sys/contrib/dev/acpica/compiler/prutils.c | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/sys/contrib/dev/acpica/compiler/prutils.c b/sys/contrib/dev/acpica/compiler/prutils.c index e36ea1d..7e880b1 100644 --- a/sys/contrib/dev/acpica/compiler/prutils.c +++ b/sys/contrib/dev/acpica/compiler/prutils.c @@ -238,9 +238,11 @@ PrReplaceData ( * ******************************************************************************/ -void +FILE * PrOpenIncludeFile ( - char *Filename) + char *Filename, + char *OpenMode, + char **FullPathname) { FILE *IncludeFile; ASL_INCLUDE_DIR *NextDir; @@ -257,12 +259,13 @@ PrOpenIncludeFile ( (Filename[0] == '\\') || (Filename[1] == ':')) { - IncludeFile = PrOpenIncludeWithPrefix ("", Filename); + IncludeFile = PrOpenIncludeWithPrefix ( + "", Filename, OpenMode, FullPathname); if (!IncludeFile) { goto ErrorExit; } - return; + return (IncludeFile); } /* @@ -273,10 +276,11 @@ PrOpenIncludeFile ( * * Construct the file pathname from the global directory name. */ - IncludeFile = PrOpenIncludeWithPrefix (Gbl_DirectoryPath, Filename); + IncludeFile = PrOpenIncludeWithPrefix ( + Gbl_DirectoryPath, Filename, OpenMode, FullPathname); if (IncludeFile) { - return; + return (IncludeFile); } /* @@ -286,10 +290,11 @@ PrOpenIncludeFile ( NextDir = Gbl_IncludeDirList; while (NextDir) { - IncludeFile = PrOpenIncludeWithPrefix (NextDir->Dir, Filename); + IncludeFile = PrOpenIncludeWithPrefix ( + NextDir->Dir, Filename, OpenMode, FullPathname); if (IncludeFile) { - return; + return (IncludeFile); } NextDir = NextDir->Next; @@ -300,6 +305,7 @@ PrOpenIncludeFile ( ErrorExit: sprintf (Gbl_MainTokenBuffer, "%s, %s", Filename, strerror (errno)); PrError (ASL_ERROR, ASL_MSG_INCLUDE_FILE_OPEN, 0); + return (NULL); } @@ -320,7 +326,9 @@ ErrorExit: FILE * PrOpenIncludeWithPrefix ( char *PrefixDir, - char *Filename) + char *Filename, + char *OpenMode, + char **FullPathname) { FILE *IncludeFile; char *Pathname; @@ -336,7 +344,7 @@ PrOpenIncludeWithPrefix ( /* Attempt to open the file, push if successful */ - IncludeFile = fopen (Pathname, "r"); + IncludeFile = fopen (Pathname, OpenMode); if (!IncludeFile) { fprintf (stderr, "Could not open include file %s\n", Pathname); @@ -346,6 +354,7 @@ PrOpenIncludeWithPrefix ( /* Push the include file on the open input file stack */ PrPushInputFileStack (IncludeFile, Pathname); + *FullPathname = Pathname; return (IncludeFile); } |