diff options
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 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);      }  }  | 
