shithub: scc

Download patch

ref: 58f31646b446beb4f2bad4535a517cde10536d83
parent: a4548bb58265af4da12c28089a828afbecda2d0a
author: Quentin Rameau <[email protected]>
date: Mon Jul 4 08:54:15 EDT 2016

[driver] remove objfile only once per build failure

--- a/driver/posix/scc.c
+++ b/driver/posix/scc.c
@@ -296,9 +296,6 @@
 			    !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 @@
 			t->pid = 0;
 		}
 	}
+	if (failed < LAST_TOOL) {
+		unlink(objfile);
+		free(objfile);
+		objfile = NULL;
+		return 0;
+	}
 
-	return failed == LAST_TOOL;
+	return 1;
 }
 
 static int