From 5b95a4276f33d182dcafa50eca83c9a078d25b04 Mon Sep 17 00:00:00 2001 From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Wed, 23 Dec 2020 16:13:44 +0000 Subject: [PATCH] Fix a hang if an on-*** script didn't launch. --- common.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common.c b/common.c index b48adad4..8520c714 100644 --- a/common.c +++ b/common.c @@ -831,10 +831,10 @@ void command_set_volume(double volume) { execv(argV[0], argV); warn("Execution of on-set-volume command \"%s\" failed to start", config.cmd_set_volume); // debug(1, "Error executing on-set-volume command %s", config.cmd_set_volume); - exit(EXIT_FAILURE); /* only if execv fails */ + _exit(EXIT_FAILURE); /* only if execv fails */ } } - + _exit(EXIT_SUCCESS); } else { if (config.cmd_blocking) { /* pid!=0 means parent process and if blocking is true, wait for process to finish */ @@ -886,7 +886,7 @@ void command_start(void) { execv(argV[0], argV); warn("Execution of on-start command failed to start"); debug(1, "Error executing on-start command %s", config.cmd_start); - exit(EXIT_FAILURE); /* only if execv fails */ + _exit(EXIT_FAILURE); /* only if execv fails */ } } else { if (config.cmd_blocking || config.cmd_start_returns_output) { /* pid!=0 means parent process @@ -942,7 +942,7 @@ void command_execute(const char *command, const char *extra_argument, const int execv(argV[0], argV); warn("Execution of command \"%s\" failed to start", full_command); debug(1, "Error executing command \"%s\".", full_command); - exit(EXIT_FAILURE); /* only if execv fails */ + _exit(EXIT_FAILURE); /* only if execv fails */ } } else { if (block) { /* pid!=0 means parent process and if blocking is true, wait for