From 2355230d67a73d7a0127392c2ae98b85e5497fb3 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Fri, 28 May 2021 02:10:00 +0300 Subject: [PATCH 54/54] server_sniff_all_input: Log fc_select() errors See osdn #42403 Signed-off-by: Marko Lindqvist --- server/sernet.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/server/sernet.c b/server/sernet.c index 4fe1aa5389..2d9a8ef97f 100644 --- a/server/sernet.c +++ b/server/sernet.c @@ -543,7 +543,9 @@ enum server_events server_sniff_all_input(void) #endif /* FREECIV_HAVE_LIBREADLINE */ while (TRUE) { - con_prompt_on(); /* accepting new input */ + int selret; + + con_prompt_on(); /* accepting new input */ if (force_end_of_sniff) { force_end_of_sniff = FALSE; @@ -694,7 +696,8 @@ enum server_events server_sniff_all_input(void) } con_prompt_off(); /* output doesn't generate a new prompt */ - if (fc_select(max_desc + 1, &readfs, &writefs, &exceptfs, &tv) == 0) { + selret = fc_select(max_desc + 1, &readfs, &writefs, &exceptfs, &tv); + if (selret == 0) { /* timeout */ call_ai_refresh(); script_server_signal_emit("pulse"); @@ -748,6 +751,8 @@ enum server_events server_sniff_all_input(void) #endif /* FREECIV_SOCKET_ZERO_NOT_STDIN */ #endif /* !__VMS */ } + } else if (selret < 0) { + log_error("fc_select() failed: %s", fc_strerror(fc_get_errno())); } excepting = FALSE; -- 2.30.2