From 198242dffbeb03bf36c965bf2bb8c39163401d89 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Fri, 28 May 2021 02:07:43 +0300 Subject: [PATCH 65/65] server_sniff_all_input: Log fc_select() errors See osdn #42403 Signed-off-by: Marko Lindqvist --- server/sernet.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/sernet.c b/server/sernet.c index 6c002e4865..450928a18f 100644 --- a/server/sernet.c +++ b/server/sernet.c @@ -544,6 +544,8 @@ enum server_events server_sniff_all_input(void) #endif /* FREECIV_HAVE_LIBREADLINE */ while (TRUE) { + int selret; + con_prompt_on(); /* accepting new input */ if (force_end_of_sniff) { @@ -695,7 +697,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"); @@ -750,6 +753,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