diff options
-rw-r--r-- | src/process.c | 9 | ||||
-rw-r--r-- | src/process.h | 2 | ||||
-rw-r--r-- | src/worker.c | 7 |
3 files changed, 12 insertions, 6 deletions
diff --git a/src/process.c b/src/process.c index bff9772..c0888b4 100644 --- a/src/process.c +++ b/src/process.c @@ -137,3 +137,12 @@ void proc_output_free(const struct proc_output *output) { free(output->output); } + +void proc_output_dump(const struct proc_output *output) +{ + log("Process exit code: %d\n", output->ec); + log("Process output:\n%s", output->output); + if (!output->output || !output->output_len || + output->output[output->output_len - 1] != '\n') + log("\n"); +} diff --git a/src/process.h b/src/process.h index 7f22a88..5726fd3 100644 --- a/src/process.h +++ b/src/process.h @@ -28,4 +28,6 @@ int proc_capture(const char *args[], const char *envp[], struct proc_output *res void proc_output_init(struct proc_output *); void proc_output_free(const struct proc_output *); +void proc_output_dump(const struct proc_output *); + #endif diff --git a/src/worker.c b/src/worker.c index 755ff35..b792ac7 100644 --- a/src/worker.c +++ b/src/worker.c @@ -95,12 +95,7 @@ static int msg_ci_run_do(const char *url, const char *rev, struct proc_output *r return ret; } - log("Process exit code: %d\n", result->ec); - log("Process output:\n%s", result->output); - if (!result->output || !result->output_len || - result->output[result->output_len - 1] != '\n') - log("\n"); - + proc_output_dump(result); return 0; } |