Block on command_execute for unfixable errors.

This commit is contained in:
Mike Brady
2019-01-15 08:30:00 +00:00
parent 68f20fe8db
commit 4483037719
4 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -739,7 +739,7 @@ void command_start(void) {
}
}
}
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];
@@ -767,7 +767,7 @@ void command_execute(const char *command, const char *extra_argument) {
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) {
+1 -1
View File
@@ -309,7 +309,7 @@ int config_set_lookup_bool(config_t *cfg, char *where, int *dst);
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);
+2 -2
View File
@@ -1098,7 +1098,7 @@ static abuf_t *buffer_get_frame(rtsp_conn_info *conn) {
(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.",
@@ -2010,7 +2010,7 @@ void *player_thread_func(void *arg) {
"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 "
+1 -1
View File
@@ -296,7 +296,7 @@ void *player_watchdog_thread_code(void *arg) {
} 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);