projects
/
ChatPrototype.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
04c00b8
)
[IOMultiplexer] fixed IOEngine_kevent.c
author
pk910
<philipp@zoelle1.de>
Sat, 22 Sep 2012 04:40:48 +0000
(06:40 +0200)
committer
pk910
<philipp@zoelle1.de>
Sat, 22 Sep 2012 04:40:48 +0000
(06:40 +0200)
src/IOEngine_kevent.c
patch
|
blob
|
history
diff --git
a/src/IOEngine_kevent.c
b/src/IOEngine_kevent.c
index 21c81efcf421bb5fe2bace8b519b055813ba8964..fb96ecd78e743e9a30df3760ad4d0bb9cc1c2471 100644
(file)
--- a/
src/IOEngine_kevent.c
+++ b/
src/IOEngine_kevent.c
@@
-18,6
+18,7
@@
#ifdef HAVE_SYS_EVENT_H
#include <sys/event.h>
#ifdef HAVE_SYS_EVENT_H
#include <sys/event.h>
+#include <errno.h>
#define MAX_EVENTS 32
#define MAX_EVENTS 32
@@
-44,7
+45,6
@@
static void engine_kevent_add(struct IODescriptor *iofd) {
res = kevent(kevent_fd, changes, nchanges, NULL, 0, NULL);
if(res < 0)
iohandler_log(IOLOG_ERROR, "could not add IODescriptor %d to kevent queue. (returned: %d)", res);
res = kevent(kevent_fd, changes, nchanges, NULL, 0, NULL);
if(res < 0)
iohandler_log(IOLOG_ERROR, "could not add IODescriptor %d to kevent queue. (returned: %d)", res);
- }
}
static void engine_kevent_remove(struct IODescriptor *iofd) {
}
static void engine_kevent_remove(struct IODescriptor *iofd) {
@@
-77,11
+77,10
@@
static void engine_kevent_update(struct IODescriptor *iofd) {
}
static void engine_kevent_loop(struct timeval *timeout) {
}
static void engine_kevent_loop(struct timeval *timeout) {
- struct kevent evts[MAX_EVENTS];
+ struct kevent ev
en
ts[MAX_EVENTS];
struct timeval now, tdiff;
struct timeval now, tdiff;
- struct timespec ts, *pt
r
+ struct timespec ts, *pt
s;
int msec;
int msec;
- int events;
int kevent_result;
gettimeofday(&now, NULL);
int kevent_result;
gettimeofday(&now, NULL);
@@
-113,7
+112,7
@@
static void engine_kevent_loop(struct timeval *timeout) {
}
//select system call
}
//select system call
- kevent_result = kevent(k
q
_fd, NULL, 0, events, MAX_EVENTS, pts);
+ kevent_result = kevent(k
event
_fd, NULL, 0, events, MAX_EVENTS, pts);
if (kevent_result < 0) {
if (errno != EINTR) {
if (kevent_result < 0) {
if (errno != EINTR) {
@@
-123,7
+122,7
@@
static void engine_kevent_loop(struct timeval *timeout) {
} else {
int i;
for(i = 0; i < kevent_result; i++)
} else {
int i;
for(i = 0; i < kevent_result; i++)
- iohandler_events(ev
ts[i].udata, (evts[i].filter == EVFILT_READ), (ev
ts[i].filter == EVFILT_WRITE));
+ iohandler_events(ev
ents[i].udata, (events[i].filter == EVFILT_READ), (even
ts[i].filter == EVFILT_WRITE));
}
//check timers
}
//check timers