diff options
author | jkim <jkim@FreeBSD.org> | 2012-09-14 22:53:11 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2012-09-14 22:53:11 +0000 |
commit | da9b951a892d96e0521abeec09d4345ddf04ab8d (patch) | |
tree | 033c7834a7ab5fe0b48b11ac066372bfd32f2c22 /source/compiler/aslcompile.c | |
parent | 08e6f22ac3350a67c38e9b42b5dce2a7d5fa08b4 (diff) | |
download | FreeBSD-src-da9b951a892d96e0521abeec09d4345ddf04ab8d.zip FreeBSD-src-da9b951a892d96e0521abeec09d4345ddf04ab8d.tar.gz |
Import ACPICA 20120913.
Diffstat (limited to 'source/compiler/aslcompile.c')
-rw-r--r-- | source/compiler/aslcompile.c | 40 |
1 files changed, 17 insertions, 23 deletions
diff --git a/source/compiler/aslcompile.c b/source/compiler/aslcompile.c index a6ffe1e..3ac3c24 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); } } |