summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2015-09-01 16:21:30 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2015-09-01 16:21:30 +0200
commit0c203b8300880d398e5df79d86b38bfba1b99329 (patch)
tree66f82de98e5c98961f730d17a14897c142dd4bd8
parenta595b3b3f74f966a421a0ca9510404645d9c3452 (diff)
downloadredo-c-0c203b8300880d398e5df79d86b38bfba1b99329.tar.gz
redo-c-0c203b8300880d398e5df79d86b38bfba1b99329.tar.xz
redo-c-0c203b8300880d398e5df79d86b38bfba1b99329.zip
Check for dofile earlier
-rw-r--r--redo.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/redo.c b/redo.c
index 7631a82..18c89dd 100644
--- a/redo.c
+++ b/redo.c
@@ -468,6 +468,12 @@ 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);
@@ -475,12 +481,6 @@ 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);