From 0c203b8300880d398e5df79d86b38bfba1b99329 Mon Sep 17 00:00:00 2001 From: Christian Neukirchen Date: Tue, 1 Sep 2015 16:21:30 +0200 Subject: Check for dofile earlier --- redo.c | 12 ++++++------ 1 file 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); -- cgit 1.4.1