From b5d4f94d9a33d9e3939d2975e9600e1a8d21da10 Mon Sep 17 00:00:00 2001 From: Lasse Rosenow Date: Tue, 10 Dec 2024 20:58:17 +0100 Subject: [PATCH] Handle select return type --- src/platform/posix/tcp_ip_channel.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/platform/posix/tcp_ip_channel.c b/src/platform/posix/tcp_ip_channel.c index 64365bf7..a8005bf9 100644 --- a/src/platform/posix/tcp_ip_channel.c +++ b/src/platform/posix/tcp_ip_channel.c @@ -407,7 +407,11 @@ static void *_TcpIpChannel_worker_thread(void *untyped_self) { max_fd = (socket > self->send_failed_event_fds) ? socket : self->send_failed_event_fds; // Wait for data or cancel if send_failed externally - select(max_fd + 1, &readfds, NULL, NULL, NULL); + ret = select(max_fd + 1, &readfds, NULL, NULL, NULL); + if (ret < 0) { + TCP_IP_CHANNEL_ERR("Select returned with error. errno=", errno); + break; + } if (FD_ISSET(socket, &readfds)) { TCP_IP_CHANNEL_DEBUG("Select -> receive");