Merge pull request #440 from LogosDesignAS/FixForAndroidApi19

Android API 19 does not support the epoll_create1
This commit is contained in:
Leonid Stryzhevskyi 2021-07-01 15:23:41 +02:00 committed by GitHub
commit ea442eae28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -39,7 +39,11 @@ namespace oatpp { namespace async { namespace worker {
void IOEventWorker::initEventQueue() {
#if !defined __ANDROID_API__ || __ANDROID_API__ >= 21
m_eventQueueHandle = ::epoll_create1(0);
#else
m_eventQueueHandle = ::epoll_create(0);
#endif
if(m_eventQueueHandle == -1) {
OATPP_LOGE("[oatpp::async::worker::IOEventWorker::initEventQueue()]", "Error. Call to ::epoll_create1() failed. errno=%d", errno);