}
}
}
-void command_execute(const char *command, const char *extra_argument) {
+void command_execute(const char *command, const char *extra_argument, const int block) {
// this has a cancellation point if waiting is enabled
if (command) {
char new_command_buffer[1024];
exit(127); /* only if execv fails */
}
} else {
- if (config.cmd_blocking) { /* pid!=0 means parent process and if blocking is true, wait for
+ if (block) { /* pid!=0 means parent process and if blocking is true, wait for
process to finish */
pid_t rc = waitpid(pid, 0, 0); /* wait for child to exit */
if (rc != pid) {
void command_start(void);
void command_stop(void);
-void command_execute(const char *command, const char *extra_argument);
+void command_execute(const char *command, const char *extra_argument, const int block);
void command_set_volume(double volume);
int mkpath(const char *path, mode_t mode);
(conn->unfixable_error_reported == 0)) {
conn->unfixable_error_reported = 1;
if (config.cmd_unfixable) {
- command_execute(config.cmd_unfixable, "output_device_stalled");
+ command_execute(config.cmd_unfixable, "output_device_stalled", 1);
} else {
warn(
"an unrecoverable error, \"output_device_stalled\", has been detected.",
"stalled. Executing the "
"\"run_this_if_an_unfixable_error_is_detected\" command.",
conn->connection_number);
- command_execute(config.cmd_unfixable, "output_device_stalled");
+ command_execute(config.cmd_unfixable, "output_device_stalled", 1);
} else {
warn("Connection %d: An unfixable error has been detected -- output device is "
"stalled. \"No "
} else if (conn->watchdog_barks == 3) {
if ((config.cmd_unfixable) && (conn->unfixable_error_reported == 0)) {
conn->unfixable_error_reported = 1;
- command_execute(config.cmd_unfixable, "unable_to_cancel_play_session");
+ command_execute(config.cmd_unfixable, "unable_to_cancel_play_session",1);
} else {
warn("an unrecoverable error, \"unable_to_cancel_play_session\", has been detected.",
conn->connection_number);