commit bd58b52d4ce42081056c08e46411ac3df2118d2b
Author:     Quentin Rameau <[email protected]>
AuthorDate: Mon Jul 4 12:54:15 2016 +0200
Commit:     Quentin Rameau <[email protected]>
CommitDate: Mon Jul 4 12:54:15 2016 +0200

    [driver] remove objfile only once per build failure

diff --git a/driver/posix/scc.c b/driver/posix/scc.c
index 3b6838d..e3b0199 100644
--- a/driver/posix/scc.c
+++ b/driver/posix/scc.c
@@ -296,9 +296,6 @@ validatetools(void)
                            !WIFEXITED(st) || WEXITSTATUS(st) != 0) {
                                failure = 1;
                                failed = tool;
-                               unlink(objfile);
-                               free(objfile);
-                               objfile = NULL;
                        }
                        if (tool >= failed && t->outfile)
                                unlink(t->outfile);
@@ -308,8 +305,14 @@ validatetools(void)
                        t->pid = 0;
                }
        }
+       if (failed < LAST_TOOL) {
+               unlink(objfile);
+               free(objfile);
+               objfile = NULL;
+               return 0;
+       }
 
-       return failed == LAST_TOOL;
+       return 1;
 }
 
 static int

Reply via email to