1
0
mirror of https://github.com/CPunch/Laika.git synced 2024-11-21 12:40:04 +00:00

lpolllist.c: fix poll ifdef paths

This commit is contained in:
CPunch 2022-09-01 20:04:54 -05:00
parent b23057b219
commit 587d9a26e5
2 changed files with 4 additions and 4 deletions

View File

@ -38,7 +38,7 @@ typedef char buffer_t;
# include <sys/epoll.h>
/* max events for epoll() */
# define MAX_EPOLL_EVENTS 128
# define LAIKA_USE_EPOLL
//# define LAIKA_USE_EPOLL
# endif
# include <errno.h>
# include <unistd.h>

View File

@ -231,14 +231,14 @@ struct sLaika_pollEvent *laikaP_poll(struct sLaika_pollList *pList, int timeout,
.pollOut = pList->ep_events[i].events & EPOLLOUT};
}
#else
nEvents = poll(pList->fds, pList->fdCount,
timeout); /* poll returns -1 for error, or the number of events */
/* poll returns -1 for error, or the number of events */
nEvents = poll(pList->fds, laikaM_countVector(pList->fds), timeout);
if (SOCKETERROR(nEvents))
LAIKA_ERROR("poll() failed!\n");
/* walk through the returned poll fds, if they have an event, add it to our revents array */
for (i = 0; i < pList->fdCount && nEvents > 0; i++) {
for (i = 0; i < laikaM_countVector(pList->fds) && nEvents > 0; i++) {
PollFD pfd = pList->fds[i];
if (pList->fds[i].revents != 0) {
/* grab socket from hashmap */