changeset 545:c0bdb6c091bc

Net: fix kqueue
author David Demelier <markand@malikania.fr>
date Tue, 14 Jun 2016 16:59:09 +0200
parents a5f488f88899
children 40c27081958a
files modules/net/net.hpp
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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{