summaryrefslogtreecommitdiff
path: root/source/compiler/aslcompile.c
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2012-09-14 22:53:11 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2012-09-14 22:53:11 +0000
commitebef5c959a0ea58fa05c4a5a80bb93104780bf87 (patch)
tree033c7834a7ab5fe0b48b11ac066372bfd32f2c22 /source/compiler/aslcompile.c
parentfc8e34d9a95f87b780f9ee3d400dd995aba2ce27 (diff)
Notes
Diffstat (limited to 'source/compiler/aslcompile.c')
-rw-r--r--source/compiler/aslcompile.c40
1 files changed, 17 insertions, 23 deletions
diff --git a/source/compiler/aslcompile.c b/source/compiler/aslcompile.c
index a6ffe1e89b90..3ac3c24d67f3 100644
--- a/source/compiler/aslcompile.c
+++ b/source/compiler/aslcompile.c
@@ -800,6 +800,7 @@ CmCleanupAndExit (
void)
{
UINT32 i;
+ BOOLEAN DeleteAmlFile = FALSE;
AePrintErrorLog (ASL_FILE_STDERR);
@@ -851,6 +852,16 @@ CmCleanupAndExit (
UtDisplaySummary (ASL_FILE_STDOUT);
+ /*
+ * We will delete the AML file if there are errors and the
+ * force AML output option has not been used.
+ */
+ if ((Gbl_ExceptionCount[ASL_ERROR] > 0) && (!Gbl_IgnoreErrors) &&
+ Gbl_Files[ASL_FILE_AML_OUTPUT].Handle)
+ {
+ DeleteAmlFile = TRUE;
+ }
+
/* Close all open files */
Gbl_Files[ASL_FILE_PREPROCESSOR].Handle = NULL; /* the .i file is same as source file */
@@ -862,29 +873,17 @@ CmCleanupAndExit (
/* Delete AML file if there are errors */
- if ((Gbl_ExceptionCount[ASL_ERROR] > 0) && (!Gbl_IgnoreErrors) &&
- Gbl_Files[ASL_FILE_AML_OUTPUT].Handle)
+ if (DeleteAmlFile)
{
- if (remove (Gbl_Files[ASL_FILE_AML_OUTPUT].Filename))
- {
- printf ("%s: ",
- Gbl_Files[ASL_FILE_AML_OUTPUT].Filename);
- perror ("Could not delete AML file");
- }
+ FlDeleteFile (ASL_FILE_AML_OUTPUT);
}
/* Delete the preprocessor output file (.i) unless -li flag is set */
if (!Gbl_PreprocessorOutputFlag &&
- Gbl_PreprocessFlag &&
- Gbl_Files[ASL_FILE_PREPROCESSOR].Filename)
+ Gbl_PreprocessFlag)
{
- if (remove (Gbl_Files[ASL_FILE_PREPROCESSOR].Filename))
- {
- printf ("%s: ",
- Gbl_Files[ASL_FILE_PREPROCESSOR].Filename);
- perror ("Could not delete preprocessor .i file");
- }
+ FlDeleteFile (ASL_FILE_PREPROCESSOR);
}
/*
@@ -901,14 +900,9 @@ CmCleanupAndExit (
*
* TBD: SourceOutput should be .TMP, then rename if we want to keep it?
*/
- if (!Gbl_SourceOutputFlag && Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename)
+ if (!Gbl_SourceOutputFlag)
{
- if (remove (Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename))
- {
- printf ("%s: ",
- Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename);
- perror ("Could not delete SRC file");
- }
+ FlDeleteFile (ASL_FILE_SOURCE_OUTPUT);
}
}