[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug gas/11728] Output file present even after gas exits with an error
From: |
sterling at tensilica dot com |
Subject: |
[Bug gas/11728] Output file present even after gas exits with an error |
Date: |
18 Jun 2010 23:51:44 -0000 |
------- Additional Comments From sterling at tensilica dot com 2010-06-18
23:51 -------
Here is my proposed patch. It just moves unlinking the file to the same function
that closes it. This delays unlinking until very very late, but I can't see why
that would be an issue.
Index: as.c
===================================================================
RCS file: /cvs/src/src/gas/as.c,v
retrieving revision 1.88
diff -u -p -d -u -r1.88 as.c
--- as.c 9 Apr 2010 14:40:18 -0000 1.88
+++ as.c 18 Jun 2010 23:38:58 -0000
@@ -98,6 +98,9 @@ int debug_memory = 0;
/* Enable verbose mode. */
int verbose = 0;
+/* Keep the output file. */
+int keep_it = 0;
+
segT reg_section;
segT expr_section;
segT text_section;
@@ -953,6 +956,8 @@ static void
close_output_file (void)
{
output_file_close (out_file_name);
+ if (!keep_it)
+ unlink_if_ordinary (out_file_name);
}
/* The interface between the macro code and gas expression handling. */
@@ -1082,7 +1087,6 @@ main (int argc, char ** argv)
char ** argv_orig = argv;
int macro_strip_at;
- int keep_it;
start_time = get_run_time ();
@@ -1245,9 +1249,6 @@ main (int argc, char ** argv)
if (had_errors () > 0 && ! flag_always_generate_output)
keep_it = 0;
- if (!keep_it)
- unlink_if_ordinary (out_file_name);
-
input_scrub_end ();
END_PROGRESS (myname);
--
http://sourceware.org/bugzilla/show_bug.cgi?id=11728
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.