From: Brian Murray Date: Mon, 26 Oct 2020 19:13:20 +0000 (+0100) Subject: Don't wait forever for a ping reply. X-Git-Tag: 22.02.122~29^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=55902ceddef767907e744df72f0d0c93b8f3dcb0;p=thirdparty%2Fplymouth.git Don't wait forever for a ping reply. In the event that plymouthd is not responding the plymouth client will wait forever when sending a ping to the daemon. Instead of waiting forever timeout after a while. https://gitlab.freedesktop.org/plymouth/plymouth/-/issues/130 --- diff --git a/src/client/plymouth.c b/src/client/plymouth.c index be74ae7b..11b89106 100644 --- a/src/client/plymouth.c +++ b/src/client/plymouth.c @@ -75,6 +75,13 @@ typedef struct char *keys; } key_answer_state_t; +ply_event_loop_timeout_handler_t timeout_handler(void *user_data) +{ + ply_event_loop_t *loop = user_data; + ply_trace ("ping: timed out waiting for plymouthd"); + ply_event_loop_exit(loop, 1); +} + static char ** split_string (const char *command, const char delimiter) @@ -1145,6 +1152,8 @@ main (int argc, on_success, (ply_boot_client_response_handler_t) on_failure, &state); + ply_event_loop_watch_for_timeout (state.loop, 30.0, + timeout_handler, state.loop); } else if (should_check_for_active_vt) { ply_boot_client_ask_daemon_has_active_vt (state.client, (ply_boot_client_response_handler_t)