From efeaf15d037e58a0a6c41db226d79bec684efa99 Mon Sep 17 00:00:00 2001 From: sinanmohd Date: Tue, 2 Jul 2024 22:21:20 +0530 Subject: jobs/stale_set: init --- src/jobs.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src') diff --git a/src/jobs.c b/src/jobs.c index 04afa4a..95566cb 100644 --- a/src/jobs.c +++ b/src/jobs.c @@ -368,6 +368,7 @@ static int job_new(struct job **j, char *name, char *drv_path, char *attr, return -errno; } job->scheduled = false; + job->stale = false; job->id = -1; job->outputs_size = 0; @@ -454,3 +455,14 @@ int jobs_init(FILE **stream, char *expr) ret = vpopen(stream, "nix-eval-jobs", args); return ret; } + +void job_stale_set(struct job *job) +{ + if (job->stale) + return; + + job->stale = true; + for (size_t i = 0; i < job->parents_filled; i++) + job_stale_set(job->parents[i]); +} + -- cgit v1.2.3