event/SocketMonitor: use class SocketDescriptor

This commit is contained in:
Max Kellermann
2017-08-10 18:25:22 +02:00
parent fcfc8bacc0
commit 492b20a89d
21 changed files with 80 additions and 83 deletions

View File

@@ -57,9 +57,9 @@ MultiSocketMonitor::ReplaceSocketList(pollfd *pfds, unsigned n)
{
pollfd *const end = pfds + n;
UpdateSocketList([pfds, end](int fd) -> unsigned {
UpdateSocketList([pfds, end](SocketDescriptor fd) -> unsigned {
auto i = std::find_if(pfds, end, [fd](const struct pollfd &pfd){
return pfd.fd == fd;
return pfd.fd == fd.Get();
});
if (i == end)
return 0;
@@ -71,7 +71,7 @@ MultiSocketMonitor::ReplaceSocketList(pollfd *pfds, unsigned n)
for (auto i = pfds; i != end; ++i)
if (i->events != 0)
AddSocket(i->fd, i->events);
AddSocket(SocketDescriptor(i->fd), i->events);
}
#endif