diff options
author | sinanmohd <sinan@sinanmohd.com> | 2024-07-02 22:21:20 +0530 |
---|---|---|
committer | sinanmohd <sinan@sinanmohd.com> | 2024-07-02 22:58:54 +0530 |
commit | efeaf15d037e58a0a6c41db226d79bec684efa99 (patch) | |
tree | 0fcf4be284de7db182c30850fbd2b20dace6b859 | |
parent | 623e4436ead7e9cd5c0d29eb14437c5cc5d20674 (diff) |
jobs/stale_set: init
-rw-r--r-- | src/jobs.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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]); +} + |