changeset 474:fb3158aca358

Socket: fix struct kevent which conflits with the function name
author David Demelier <markand@malikania.fr>
date Fri, 06 Nov 2015 15:09:00 +0100
parents 5a9671dabb15
children b681299e6987 1ff22c1cb32e
files C++/modules/Socket/Sockets.cpp C++/modules/Socket/Sockets.h
diffstat 2 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/C++/modules/Socket/Sockets.cpp	Thu Nov 05 22:28:40 2015 +0100
+++ b/C++/modules/Socket/Sockets.cpp	Fri Nov 06 15:09:00 2015 +0100
@@ -637,9 +637,9 @@
 
 void Kqueue::update(Handle h, int filter, int kflags)
 {
-	kevent ev;
+	struct kevent ev;
 
-	EV_SET(&ev, h, filter, flags, 0, 0, nullptr);
+	EV_SET(&ev, h, filter, kflags, 0, 0, nullptr);
 
 	if (kevent(m_handle, &ev, 1, nullptr, 0, nullptr) < 0) {
 		throw Error{Error::System, "kevent"};
@@ -662,10 +662,10 @@
 
 void Kqueue::unset(const ListenerTable &, Handle h, Condition condition, bool remove)
 {
-	if ((flags & Condition::Readable) == Condition::Readable) {
+	if ((condition & Condition::Readable) == Condition::Readable) {
 		update(h, EVFILT_READ, EV_DELETE);
 	}
-	if ((flags & Condition::Writable) == Condition::Writable) {
+	if ((condition & Condition::Writable) == Condition::Writable) {
 		update(h, EVFILT_WRITE, EV_DELETE);
 	}
 
--- a/C++/modules/Socket/Sockets.h	Thu Nov 05 22:28:40 2015 +0100
+++ b/C++/modules/Socket/Sockets.h	Fri Nov 06 15:09:00 2015 +0100
@@ -2934,7 +2934,7 @@
  */
 class Kqueue {
 private:
-	std::vector<kevent> m_result;
+	std::vector<struct kevent> m_result;
 	int m_handle;
 
 	Kqueue(const Kqueue &) = delete;