From 4de1ce83e1d45bb3206770895dc84b26aaf76f18 Mon Sep 17 00:00:00 2001 From: Christian Neukirchen Date: Tue, 1 Sep 2015 16:47:29 +0200 Subject: Skip over nonexisting files in record_deps --- redo.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/redo.c b/redo.c index 08dbbb4..5dc8064 100644 --- a/redo.c +++ b/redo.c @@ -700,14 +700,18 @@ static void record_deps(int targetc, char *targetv[]) { int targeti = 0; + int fd; dep_fd = envfd("REDO_DEP_FD"); + if (dep_fd < 0) + return; for (targeti = 0; targeti < targetc; targeti++) { - int fd = open(targetv[targeti], O_RDONLY); - char *hash = hashfile(fd); + fd = open(targetv[targeti], O_RDONLY); + if (fd < 0) + continue; // here, we write out the unmodified target name! - dprintf(dep_fd, "=%s!%s\n", hash, targetv[targeti]); + dprintf(dep_fd, "=%s!%s\n", hashfile(fd), targetv[targeti]); close(fd); } } -- cgit 1.4.1