about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2015-09-01 16:39:06 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2015-09-01 16:39:06 +0200
commit58c2bd8df65d3704b2a6cdde0bf347d58036685f (patch)
treeb447fc2b399a00839a82973be421dea337f23570
parent833ffe26027512ec156dcc7bbdf78131165196cd (diff)
downloadredo-c-58c2bd8df65d3704b2a6cdde0bf347d58036685f.tar.gz
redo-c-58c2bd8df65d3704b2a6cdde0bf347d58036685f.tar.xz
redo-c-58c2bd8df65d3704b2a6cdde0bf347d58036685f.zip
Revert "Check for dofile earlier"
Then the ifcreate end up in the wrong dep file.

This reverts commit 0c203b8300880d398e5df79d86b38bfba1b99329.
-rw-r--r--redo.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/redo.c b/redo.c
index 781c828..08dbbb4 100644
--- a/redo.c
+++ b/redo.c
@@ -468,12 +468,6 @@ run_script(char *target, int implicit)
 
 	target = targetchdir(target);
 
-	dofile = find_dofile(target);
-	if (!dofile) {
-		fprintf(stderr, "no dofile for %s.\n", target);
-		exit(1);
-	}
-
 	dep_fd = mkstemp(temp_depfile);
 
 	fd = mkstemp(temp_target);
@@ -481,6 +475,12 @@ run_script(char *target, int implicit)
 
 	// TODO locking to detect parallel jobs building same target?
 
+	dofile = find_dofile(target);
+	if (!dofile) {
+		fprintf(stderr, "no dofile for %s.\n", target);
+		exit(1);
+	}
+
 	fd = open(dofile, O_RDONLY);
 	dprintf(dep_fd, "=%s %s\n", hashfile(fd), dofile);
 	close(fd);