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
This commit is contained in:
Rafael Avila de Espindola 2009-11-24 15:00:15 +00:00 committed by Rafael Espindola
parent 338877519d
commit 8aea79e6c9
2 changed files with 19 additions and 6 deletions

View File

@ -1,3 +1,8 @@
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>
* Makefile.in (PLUGIN_HEADERS): Added files: cppdefault.h flags.h

View File

@ -66,12 +66,20 @@ static void maybe_unlink_file (const char *);
static void
lto_wrapper_exit (int status)
{
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);
static bool cleanup_done = false;
if (!cleanup_done)
{
/* Setting cleanup_done prevents an infinite loop if one of the
calls to maybe_unlink_file fails. */
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);
}