diff options
-rw-r--r-- | src/process.c | 7 | ||||
-rw-r--r-- | src/process.h | 1 | ||||
-rw-r--r-- | src/worker.c | 1 |
3 files changed, 9 insertions, 0 deletions
diff --git a/src/process.c b/src/process.c index fa15641..1a4b032 100644 --- a/src/process.c +++ b/src/process.c @@ -114,6 +114,13 @@ close_pipe: return ret; } +void proc_output_init(struct proc_output *output) +{ + output->ec = 0; + output->output = NULL; + output->output_len = 0; +} + void proc_output_free(const struct proc_output *output) { free(output->output); diff --git a/src/process.h b/src/process.h index d47536f..b378ad1 100644 --- a/src/process.h +++ b/src/process.h @@ -18,6 +18,7 @@ int proc_spawn(const char *args[], int *ec); * In that case, you'll need to free the output. */ int proc_capture(const char *args[], struct proc_output *result); +void proc_output_init(struct proc_output *); void proc_output_free(const struct proc_output *); #endif diff --git a/src/worker.c b/src/worker.c index baba9b0..fef6b78 100644 --- a/src/worker.c +++ b/src/worker.c @@ -87,6 +87,7 @@ static int msg_ci_run_handler(struct worker *worker, const struct msg *request) struct proc_output result; int ret = 0; + proc_output_init(&result); ret = msg_ci_run_do(request->argv[1], request->argv[2], &result); proc_output_free(&result); |