diff options
author | Benoit Foucher <benoit@zeroc.com> | 2017-01-05 15:44:10 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2017-01-05 15:44:10 +0100 |
commit | 12631cf162560150b056bb6565d87d8bb58fa2e8 (patch) | |
tree | 804ab8f6bf5900ee5f8a3971ccf8bbf0bda77c07 /cpp/src | |
parent | Bumped ACM timeout (diff) | |
download | ice-12631cf162560150b056bb6565d87d8bb58fa2e8.tar.bz2 ice-12631cf162560150b056bb6565d87d8bb58fa2e8.tar.xz ice-12631cf162560150b056bb6565d87d8bb58fa2e8.zip |
Fixed ICE-7419 - spurious error message from kqueue selector
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Ice/Selector.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/cpp/src/Ice/Selector.cpp b/cpp/src/Ice/Selector.cpp index af568dccac7..b60669446d8 100644 --- a/cpp/src/Ice/Selector.cpp +++ b/cpp/src/Ice/Selector.cpp @@ -22,6 +22,13 @@ using namespace std; using namespace IceInternal; +#if defined(ICE_USE_KQUEUE) +namespace +{ +struct timespec zeroTimeout = { 0, 0 }; +} +#endif + #ifdef ICE_OS_WINRT using namespace Windows::Foundation; using namespace Windows::Storage::Streams; @@ -450,12 +457,27 @@ Selector::finish(EventHandler* handler, bool closeNow) void Selector::updateSelector() { - int rs = kevent(_queueFd, &_changes[0], _changes.size(), 0, 0, 0); + int rs = kevent(_queueFd, &_changes[0], _changes.size(), &_changes[0], _changes.size(), &zeroTimeout); if(rs < 0) { Ice::Error out(_instance->initializationData().logger); out << "error while updating selector:\n" << IceUtilInternal::errorToString(IceInternal::getSocketErrno()); } + else + { + for(int i = 0; i < rs; ++i) + { + // + // Check for errors, we ignore EINPROGRESS that started showing up with macOS Sierra + // and which occurs when another thread removes the FD from the kqueue (see ICE-7419). + // + if(_changes[i].flags & EV_ERROR && _changes[i].data != EINPROGRESS) + { + Ice::Error out(_instance->initializationData().logger); + out << "error while updating selector:\n" << IceUtilInternal::errorToString(_changes[i].data); + } + } + } _changes.clear(); } #endif |