Skip to content
This repository has been archived by the owner on Oct 16, 2021. It is now read-only.

Commit

Permalink
store pointer instead of using array reference all over the place
Browse files Browse the repository at this point in the history
  • Loading branch information
jBarz committed Jun 11, 2018
1 parent f23cdc8 commit aead219
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions deps/uv/src/unix/os390-syscalls.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,18 +308,20 @@ int epoll_wait(uv__os390_epoll* lst, struct epoll_event* events,
for (int i = 0;
i < lst->size && i < maxevents && reventcount < pollret; ++i) {
struct epoll_event ev;
struct pollfd* pfd;

if (pfds[i].fd == -1 || pfds[i].revents == 0)
pfd = &pfds[i];
if (pfd->fd == -1 || pfd->revents == 0)
continue;

ev.fd = pfds[i].fd;
ev.events = pfds[i].revents;
if (pfds[i].revents & POLLIN && pfds[i].revents & POLLOUT)
ev.fd = pfd->fd;
ev.events = pfd->revents;
if (pfd->revents & POLLIN && pfd->revents & POLLOUT)
reventcount += 2;
else if (pfds[i].revents & (POLLIN | POLLOUT))
else if (pfd->revents & (POLLIN | POLLOUT))
++reventcount;

pfds[i].revents = 0;
pfd->revents = 0;
events[nevents++] = ev;
}

Expand Down

0 comments on commit aead219

Please sign in to comment.