diff options
Diffstat (limited to 'gcc/ada/gnatcmd.adb')
-rw-r--r-- | gcc/ada/gnatcmd.adb | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/gcc/ada/gnatcmd.adb b/gcc/ada/gnatcmd.adb index 1a25dc8347f..28bccf0db10 100644 --- a/gcc/ada/gnatcmd.adb +++ b/gcc/ada/gnatcmd.adb @@ -865,11 +865,18 @@ procedure GNATCmd is if Return_Code /= 0 then Get_Line (File, Line, Last); - if not Keep_Temporary_Files then - Delete (File); - else - Close (File); - end if; + begin + if not Keep_Temporary_Files then + Delete (File); + else + Close (File); + end if; + + exception + -- Don't crash if it is not possible to delete or close the file + when others => + null; + end; Put_Line (Standard_Error, Line (1 .. Last)); Put_Line |