about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristian Kögler <ck3d@gmx.de>2020-09-06 21:27:59 +0200
committerLeah Neukirchen <leah@vuxu.org>2020-09-06 22:52:13 +0200
commit3a3f0056f357b4fa2b9f725725806d370395ff39 (patch)
tree77f932e59c0bd296d89325e66d99bf25d8a40ce5
parentba968f2161ffb4e936c283487249ea28601964c4 (diff)
downloadredo-c-3a3f0056f357b4fa2b9f725725806d370395ff39.tar.gz
redo-c-3a3f0056f357b4fa2b9f725725806d370395ff39.tar.xz
redo-c-3a3f0056f357b4fa2b9f725725806d370395ff39.zip
Fix non implicit job lease detection
If a job is non implicit, the job lease will never be written back via
function vacate. The information non implicit is wrongly derived by the
counter implicit_jobs, which will never be negative and therefor
run_script is always called with implicit job true.

This fix checks if implicit is possible before procuring the job lease.

Closes: #5 [via git-merge-pr]
-rw-r--r--redo.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/redo.c b/redo.c
index ad8b156..6f2f9d3 100644
--- a/redo.c
+++ b/redo.c
@@ -816,10 +816,11 @@ redo_ifchange(int targetc, char *targetv[])
 				continue;
 			}
 
+			int implicit = implicit_jobs > 0;
 			if (try_procure()) {
 				procured = 1;
 				targeti++;
-				run_script(target, implicit_jobs >= 0);
+				run_script(target, implicit);
 			}
 		}