collect-utils.c (collect_wait): Unlink the response file here instead of...
authorTristan Gingold <gingold@adacore.com>
Tue, 23 Jun 2015 20:48:07 +0000 (20:48 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Tue, 23 Jun 2015 20:48:07 +0000 (20:48 +0000)
* collect-utils.c (collect_wait): Unlink the response file here
instead of...
(do_wait): ...here.
(utils_cleanup): ...and here.

From-SVN: r224858

gcc/ChangeLog
gcc/collect-utils.c

index 5ab37bda56344897f871e7a017606ce8a20c6d97..ab34ffcb2b2015f399660bd458ccd3ae91a4229f 100644 (file)
@@ -1,3 +1,10 @@
+2015-06-23  Tristan Gingold  <gingold@adacore.com>
+
+       * collect-utils.c (collect_wait): Unlink the response file here
+       instead of...
+       (do_wait): ...here.
+       (utils_cleanup): ...and here.
+
 2015-06-23  Richard Sandiford  <richard.sandiford@arm.com>
 
        * df-scan.c: Don't include target-def.h.
index 6bbe9eb86980e3f033e4b29f48e457e5c27e1439..517a0757590d2a7035ccf6d9d116ce4050147ea9 100644 (file)
@@ -68,6 +68,12 @@ collect_wait (const char *prog, struct pex_obj *pex)
     fatal_error (input_location, "can't get program status: %m");
   pex_free (pex);
 
+  if (response_file && !save_temps)
+    {
+      unlink (response_file);
+      response_file = NULL;
+    }
+
   if (status)
     {
       if (WIFSIGNALED (status))
@@ -90,12 +96,6 @@ do_wait (const char *prog, struct pex_obj *pex)
   int ret = collect_wait (prog, pex);
   if (ret != 0)
     fatal_error (input_location, "%s returned %d exit status", prog, ret);
-
-  if (response_file && !save_temps)
-    {
-      unlink (response_file);
-      response_file = NULL;
-    }
 }
 
 \f
@@ -224,7 +224,5 @@ utils_cleanup (bool from_signal)
      calls to maybe_unlink fails. */
   cleanup_done = true;
 
-  if (response_file)
-    maybe_unlink (response_file);
   tool_cleanup (from_signal);
 }