From 8d124e1085f6da32034f249cb5ec4d59841cdf4b Mon Sep 17 00:00:00 2001 From: Toni Uhlig Date: Sat, 13 Aug 2022 23:40:46 +0200 Subject: [PATCH] changed select(nfds, ...) to select(nfds + 1, ...), see `man 3 select` Signed-off-by: Toni Uhlig --- sslh-select.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sslh-select.c b/sslh-select.c index 82620d4..aa8b14e 100644 --- a/sslh-select.c +++ b/sslh-select.c @@ -143,9 +143,9 @@ void main_loop(struct listen_endpoint listen_sockets[], int num_addr_listen) memcpy(&readfds, &fd_info.watchers->fds_r, sizeof(readfds)); memcpy(&writefds, &fd_info.watchers->fds_w, sizeof(writefds)); - print_message(msg_fd, "selecting... max_fd=%d num_probing=%d\n", + print_message(msg_fd, "selecting... max_fd=%d num_probing=%d\n", fd_info.watchers->max_fd, fd_info.num_probing); - res = select(fd_info.watchers->max_fd, &readfds, &writefds, + res = select(fd_info.watchers->max_fd + 1, &readfds, &writefds, NULL, fd_info.num_probing ? &tv : NULL); if (res < 0) perror("select");