Skip to content

Commit

Permalink
Handle select return type
Browse files Browse the repository at this point in the history
  • Loading branch information
LasseRosenow committed Dec 10, 2024
1 parent cdebe93 commit b5d4f94
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/platform/posix/tcp_ip_channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit b5d4f94

Please sign in to comment.