This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
A collect2 patch
- To: egcs-patches at cygnus dot com
- Subject: A collect2 patch
- From: hjl at lucon dot org (H.J. Lu)
- Date: Sat, 27 Jun 1998 16:32:52 -0700 (PDT)
Hi,
This patch cleans up the garbage left behind by collect2.
--
H.J. Lu (hjl@gnu.org)
---
Sat Jun 27 16:07:15 1998 H.J. Lu (hjl@gnu.org)
* collect2.c (collect_exit): Remove temp_filename.
(handler): Likewise.
(main): Likewise.
Index: collect2.c
===================================================================
RCS file: /home/work/cvs/gnu/egcs/gcc/collect2.c,v
retrieving revision 1.1.1.18
diff -u -p -r1.1.1.18 collect2.c
--- collect2.c 1998/06/24 16:41:59 1.1.1.18
+++ collect2.c 1998/06/27 23:25:48
@@ -364,6 +364,9 @@ void
collect_exit (status)
int status;
{
+ if (temp_filename != 0 && temp_filename [0])
+ maybe_unlink (temp_filename);
+
if (c_file != 0 && c_file[0])
maybe_unlink (c_file);
@@ -442,6 +445,9 @@ static void
handler (signo)
int signo;
{
+ if (temp_filename != 0 && temp_filename [0])
+ maybe_unlink (temp_filename);
+
if (c_file != 0 && c_file[0])
maybe_unlink (c_file);
@@ -1441,6 +1447,7 @@ main (argc, argv)
if (import_file != 0 && import_file[0])
maybe_unlink (import_file);
#endif
+ maybe_unlink (temp_filename);
return 0;
}
@@ -1558,6 +1565,7 @@ main (argc, argv)
scan_prog_file (output_file, PASS_SECOND);
#endif
+ maybe_unlink (temp_filename);
maybe_unlink (c_file);
maybe_unlink (o_file);