diff options
author | Someone Serge <else@someonex.net> | 2024-06-25 17:19:58 +0000 |
---|---|---|
committer | SomeoneSerge <else@someonex.net> | 2024-06-28 12:29:45 +0000 |
commit | 2aa52fb69694d15a5ad1e2e9dd2894f13d383734 (patch) | |
tree | f13ac0d190d9ace49014928ce17c9db7d0582a55 | |
parent | f93d74d857bdb006fbd4d6691b058985dd2e6e51 (diff) |
comments: evanix.c
-rw-r--r-- | include/jobs.h | 3 | ||||
-rw-r--r-- | src/evanix.c | 10 | ||||
-rw-r--r-- | src/jobs.c | 2 |
3 files changed, 8 insertions, 7 deletions
diff --git a/include/jobs.h b/include/jobs.h index 37445c1..2e30547 100644 --- a/include/jobs.h +++ b/include/jobs.h @@ -36,7 +36,8 @@ typedef enum { } job_read_state_t; int job_read(FILE *stream, struct job **jobs); -int jobs_init(FILE **stream, char *expr); +/* Spawns nix-eval-jobs and connects its stdout to stream */ +int jobs_init(FILE **stream, const char *expr); void job_free(struct job *j); int job_parents_list_insert(struct job *job, struct job *parent); void job_deps_list_rm(struct job *job, struct job *dep); diff --git a/src/evanix.c b/src/evanix.c index 01279d1..27ab428 100644 --- a/src/evanix.c +++ b/src/evanix.c @@ -33,22 +33,22 @@ static int evanix(char *expr) { struct queue_thread *queue_thread = NULL; struct build_thread *build_thread = NULL; - FILE *stream = NULL; + FILE *jobsStream = NULL; /* nix-eval-jobs stdout */ int ret = 0; - ret = jobs_init(&stream, expr); + ret = jobs_init(&jobsStream, expr); if (ret < 0) goto out_free; - ret = queue_thread_new(&queue_thread, stream); + ret = queue_thread_new(&queue_thread, jobsStream); if (ret < 0) { - free(stream); + free(jobsStream); goto out_free; } ret = build_thread_new(&build_thread, queue_thread->queue); if (ret < 0) { - free(stream); + free(jobsStream); goto out_free; } @@ -434,7 +434,7 @@ out_free_job: return ret; } -int jobs_init(FILE **stream, char *expr) +int jobs_init(FILE **stream, const char *expr) { size_t argindex; char *args[6]; |