# HG changeset patch # User David Demelier # Date 1465916349 -7200 # Node ID c0bdb6c091bcbecbab1fc61468952f989880776d # Parent a5f488f88899ba773c5ac7f24d1f110ed8c1255d Net: fix kqueue diff -r a5f488f88899 -r c0bdb6c091bc modules/net/net.hpp --- a/modules/net/net.hpp Tue Jun 14 15:11:11 2016 +0200 +++ b/modules/net/net.hpp Tue Jun 14 16:59:09 2016 +0200 @@ -1687,7 +1687,7 @@ else throw Error(error); #else - if (errno == EWOULDBLOCK || errno = EAGAIN) + if (errno == EWOULDBLOCK || errno == EAGAIN) throw WouldBlockError(); else throw Error(); @@ -3406,7 +3406,7 @@ EV_SET(&ev, h, filter, kflags, 0, 0, nullptr); if (kevent(m_handle, &ev, 1, nullptr, 0, nullptr) < 0) - throw Error(Error::System, "kevent"); + throw Error(); } public: @@ -3419,7 +3419,7 @@ : m_handle(kqueue()) { if (m_handle < 0) - throw Error(Error::System, "kqueue"); + throw Error(); } /** @@ -3507,9 +3507,9 @@ int nevents = kevent(m_handle, nullptr, 0, &m_result[0], m_result.capacity(), pts); if (nevents == 0) - throw Error(Error::Timeout, "kevent", std::strerror(ETIMEDOUT)); + throw TimeoutError(); if (nevents < 0) - throw Error(Error::System, "kevent"); + throw Error(); for (int i = 0; i < nevents; ++i) { sockets.push_back(ListenerStatus{