mirror of
https://github.com/pocoproject/poco.git
synced 2024-12-12 10:13:51 +01:00
Fix epollfd validity checks when compiling with wepoll (#3855)
This commit is contained in:
parent
c693b0b1b2
commit
85c68e7a81
@ -88,10 +88,11 @@ public:
|
||||
{
|
||||
#ifdef WEPOLL_H_
|
||||
if (_eventfd >= 0) eventfd(_port, _eventfd);
|
||||
if (_epollfd) close(_epollfd);
|
||||
#else
|
||||
if (_eventfd > 0) close(_eventfd.exchange(0));
|
||||
#endif
|
||||
if (_epollfd >= 0) close(_epollfd);
|
||||
#endif
|
||||
}
|
||||
|
||||
void add(const Socket& socket, int mode)
|
||||
@ -146,7 +147,11 @@ public:
|
||||
close(_epollfd);
|
||||
_socketMap.clear();
|
||||
_epollfd = epoll_create(1);
|
||||
#ifdef WEPOLL_H_
|
||||
if (!_epollfd) SocketImpl::error();
|
||||
#else
|
||||
if (_epollfd < 0) SocketImpl::error();
|
||||
#endif
|
||||
}
|
||||
#ifdef WEPOLL_H_
|
||||
eventfd(_port, _eventfd);
|
||||
|
@ -646,7 +646,12 @@ bool SocketImpl::poll(const Poco::Timespan& timeout, int mode)
|
||||
#else
|
||||
int epollfd = epoll_create(1);
|
||||
#endif
|
||||
|
||||
#ifdef WEPOLL_H_
|
||||
if (!epollfd)
|
||||
#else
|
||||
if (epollfd < 0)
|
||||
#endif
|
||||
{
|
||||
error("Can't create epoll queue");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user