Commit 8aea79e6 by Rafael Avila de Espindola Committed by Rafael Espindola

lto-wrapper.c (lto_wrapper_exit): Don't try to delete files if being called recursively.

2009-11-24  Rafael Avila de Espindola  <espindola@google.com>

       * lto-wrapper.c (lto_wrapper_exit): Don't try to delete files if
       being called recursively.

From-SVN: r154500
parent 33887751
2009-11-24 Rafael Avila de Espindola <espindola@google.com>
* lto-wrapper.c (lto_wrapper_exit): Don't try to delete files if
being called recursively.
2009-11-24 Basile Starynkevitch <basile@starynkevitch.net> 2009-11-24 Basile Starynkevitch <basile@starynkevitch.net>
* Makefile.in (PLUGIN_HEADERS): Added files: cppdefault.h flags.h * Makefile.in (PLUGIN_HEADERS): Added files: cppdefault.h flags.h
...@@ -66,12 +66,20 @@ static void maybe_unlink_file (const char *); ...@@ -66,12 +66,20 @@ static void maybe_unlink_file (const char *);
static void static void
lto_wrapper_exit (int status) lto_wrapper_exit (int status)
{ {
if (ltrans_output_file) static bool cleanup_done = false;
maybe_unlink_file (ltrans_output_file); if (!cleanup_done)
if (flto_out) {
maybe_unlink_file (flto_out); /* Setting cleanup_done prevents an infinite loop if one of the
if (args_name) calls to maybe_unlink_file fails. */
maybe_unlink_file (args_name); cleanup_done = true;
if (ltrans_output_file)
maybe_unlink_file (ltrans_output_file);
if (flto_out)
maybe_unlink_file (flto_out);
if (args_name)
maybe_unlink_file (args_name);
}
exit (status); exit (status);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment