From ad1e4def117c54b6f6578825f3ac7e79ccd584f5 Mon Sep 17 00:00:00 2001
From: Kubat <mael.martin31@gmail.com>
Date: Wed, 1 Dec 2021 22:08:33 +0100
Subject: [PATCH] MISC: Set a comparaison to what it was on the master branch
 and fix windows poll() signature

---
 inc/lektor/internal/os.h | 2 +-
 src/net/listen.c         | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/inc/lektor/internal/os.h b/inc/lektor/internal/os.h
index 614ac88c..caaf5c85 100644
--- a/inc/lektor/internal/os.h
+++ b/inc/lektor/internal/os.h
@@ -221,7 +221,7 @@ is_error_broken_pipe(int UNUSED error)
 
 #if defined(LKT_OS_WIN) && (LKT_OS_WIN == 1)
 PRIVATE_FUNCTION int
-poll(LPWSAPOLLFD *fds, ULONG nfds, INT timeout)
+poll(LPWSAPOLLFD fds, ULONG nfds, INT timeout)
 {
     return WSAPoll(fds, nfds, timeout);
 }
diff --git a/src/net/listen.c b/src/net/listen.c
index 38ba57a6..6abd280f 100644
--- a/src/net/listen.c
+++ b/src/net/listen.c
@@ -727,7 +727,7 @@ handle_network_events(struct lkt_state *srv)
         msg = NULL;
     }
 
-    for (size_t i = 1; i <= srv->fds_len; i++) {
+    for (size_t i = 1; i < srv->fds_len; i++) {
         if (!srv->fds[i].revents)
             continue;
         if (srv->fds[i].revents & (POLLHUP | POLLERR)) {
-- 
GitLab