Add parameter to redirect stderr to shell_exec()

Add a function parameter to allows redirecting stderr in addition to
stdin and stdout. The parameter will be used with a follow-up change.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
This commit is contained in:
Lukas Fleischer
2021-04-04 10:43:26 -04:00
parent f41955e491
commit 5710a8bd7f
6 changed files with 37 additions and 18 deletions

View File

@@ -53,8 +53,8 @@ int run_hook(const char *name)
arg[0] = hook_cmd;
arg[1] = NULL;
if ((pid = shell_exec(NULL, NULL, *arg, arg))) {
ret = child_wait(NULL, NULL, pid);
if ((pid = shell_exec(NULL, NULL, NULL, *arg, arg))) {
ret = child_wait(NULL, NULL, NULL, pid);
if (ret > 0 && WIFEXITED(ret)) {
asprintf(&mesg, "%s hook: exit status %d",
name,