Commit 80170ba7 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont
Browse files

fixups: add missing poll() event flags

parent 62e6b50f
...@@ -97,9 +97,9 @@ int (poll) (struct pollfd *fds, unsigned nfds, int timeout) ...@@ -97,9 +97,9 @@ int (poll) (struct pollfd *fds, unsigned nfds, int timeout)
return -1; return -1;
} }
#endif #endif
if (fds[i].events & POLLIN) if (fds[i].events & POLLRDNORM)
FD_SET (fd, rdset); FD_SET (fd, rdset);
if (fds[i].events & POLLOUT) if (fds[i].events & POLLWRNORM)
FD_SET (fd, wrset); FD_SET (fd, wrset);
if (fds[i].events & POLLPRI) if (fds[i].events & POLLPRI)
FD_SET (fd, exset); FD_SET (fd, exset);
...@@ -145,8 +145,8 @@ int (poll) (struct pollfd *fds, unsigned nfds, int timeout) ...@@ -145,8 +145,8 @@ int (poll) (struct pollfd *fds, unsigned nfds, int timeout)
for (unsigned i = 0; i < nfds; i++) for (unsigned i = 0; i < nfds; i++)
{ {
int fd = fds[i].fd; int fd = fds[i].fd;
fds[i].revents = (FD_ISSET (fd, rdset) ? POLLIN : 0) fds[i].revents = (FD_ISSET (fd, rdset) ? POLLRDNORM : 0)
| (FD_ISSET (fd, wrset) ? POLLOUT : 0) | (FD_ISSET (fd, wrset) ? POLLWRNORM : 0)
| (FD_ISSET (fd, exset) ? POLLPRI : 0); | (FD_ISSET (fd, exset) ? POLLPRI : 0);
} }
#ifdef _WIN32 #ifdef _WIN32
......
...@@ -273,13 +273,17 @@ const char *inet_ntop(int, const void *, char *, int); ...@@ -273,13 +273,17 @@ const char *inet_ntop(int, const void *, char *, int);
#ifndef HAVE_STRUCT_POLLFD #ifndef HAVE_STRUCT_POLLFD
enum enum
{ {
POLLIN=1, POLLERR=0x1,
POLLOUT=2, POLLHUP=0x2,
POLLPRI=4, POLLNVAL=0x4,
POLLERR=8, // unsupported stub POLLWRNORM=0x10,
POLLHUP=16, // unsupported stub POLLWRBAND=0x20,
POLLNVAL=32 // unsupported stub POLLRDNORM=0x100,
POLLRDBAND=0x200,
POLLPRI=0x400,
}; };
#define POLLIN (POLLRDNORM|POLLRDBAND)
#define POLLOUT (POLLWRNORM|POLLWRBAND)
struct pollfd struct pollfd
{ {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment