From 0b507849044f50bcbd98813888885aaa440f764f Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Tue, 19 Dec 2023 13:41:45 -0700 Subject: [PATCH] support TCP_SOCKET_STATE_LISTENING sockets in poll Signed-off-by: Joel Dice --- libc-bottom-half/cloudlibc/src/libc/poll/poll.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libc-bottom-half/cloudlibc/src/libc/poll/poll.c b/libc-bottom-half/cloudlibc/src/libc/poll/poll.c index dd030cbe8..1c05e51fd 100644 --- a/libc-bottom-half/cloudlibc/src/libc/poll/poll.c +++ b/libc-bottom-half/cloudlibc/src/libc/poll/poll.c @@ -156,7 +156,8 @@ static int poll_preview2(struct pollfd* fds, size_t nfds, int timeout) case DESCRIPTOR_TABLE_ENTRY_TCP_SOCKET: { tcp_socket_t* socket = &(entry->tcp_socket); switch (socket->state.tag) { - case TCP_SOCKET_STATE_CONNECTING: { + case TCP_SOCKET_STATE_CONNECTING: + case TCP_SOCKET_STATE_LISTENING: { if ((pollfd->events & (POLLRDNORM | POLLWRNORM)) != 0) { states[state_index++] = (state_t) { .pollable = socket->socket_pollable,