]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Fix a hang if an on-*** script didn't launch.
authorMike Brady <4265913+mikebrady@users.noreply.github.com>
Wed, 23 Dec 2020 16:13:44 +0000 (16:13 +0000)
committerMike Brady <4265913+mikebrady@users.noreply.github.com>
Wed, 23 Dec 2020 16:13:44 +0000 (16:13 +0000)
common.c

index b48adad4952cf66d107de40da2b3d85219099a7b..8520c71475694cd92022c4ab19dbaaabc991968f 100644 (file)
--- 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