MXS-1405: Capture subprocess output

The output by the subprocesses launched by the externcmd system is now
captured and logged.
This commit is contained in:
Markus Mäkelä
2017-09-14 18:09:35 +03:00
parent eab7b7e2a3
commit 7e6e8d3e29
3 changed files with 108 additions and 52 deletions

View File

@ -55,11 +55,14 @@ void externcmd_free(EXTERNCMD* cmd);
/**
* Execute a command
*
* @param cmd Command to execute
* The output of the command must be freed by the caller by calling MXS_FREE.
*
* @param cmd Command to execute
* @param dest Pointer where to store the output of the command
*
* @return The return value of the executed command or -1 on error
*/
int externcmd_execute(EXTERNCMD* cmd);
int externcmd_execute(EXTERNCMD* cmd, char** dest);
/**
* Substitute all occurrences of @c match with @c replace in the arguments for @c cmd