diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2023-05-14 18:40:11 +0200 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2023-05-14 18:41:32 +0200 |
commit | cb6b3c47dc5c3cb4ab391a082fe0666066fdd4f4 (patch) | |
tree | 315e9324d82ffae8e64c846585c94928406c0eb5 /src/process.c | |
parent | msg: add functions for one-off communication (diff) | |
download | cimple-cb6b3c47dc5c3cb4ab391a082fe0666066fdd4f4.tar.gz cimple-cb6b3c47dc5c3cb4ab391a082fe0666066fdd4f4.zip |
process: add process_output_dump
Diffstat (limited to 'src/process.c')
-rw-r--r-- | src/process.c | 9 |
1 files changed, 9 insertions, 0 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"); +} |