]> PatchyGit - patchyircd.git/commitdiff
netpoll: log when EBADF happens
authorEgor <egor@patchysicp.xyz>
Mon, 17 Mar 2025 18:19:35 +0000 (20:19 +0200)
committerEgor <egor@patchysicp.xyz>
Mon, 17 Mar 2025 18:20:12 +0000 (20:20 +0200)
src/netpoll.cpp

index aae80a6..8e5b9d7 100644 (file)
@@ -295,6 +295,10 @@ static void net_poll_cb(uv_poll_t *handle, int status, int events)
                poll->revents = events;
        }
        uv_poll_stop(handle);
+       if (status == -EBADF) {
+               fprintf(stderr, "net_poll_cb: %d EBADF!\n", poll->fd);
+               net_poll_del_and_close(poll->fd);
+       }
        lastptr = 0;
 }
 static void net_poll_reg_impl(int i, int ev)