summaryrefslogtreecommitdiff
path: root/src/fdevent_freebsd_kqueue.c
diff options
context:
space:
mode:
authorJan Kneschke <jan@kneschke.de>2005-09-01 07:47:40 +0000
committerJan Kneschke <jan@kneschke.de>2005-09-01 07:47:40 +0000
commit478053510bac72960b77cb68b3a5b167f3c8d6cd (patch)
tree003fc51975e57561891051d86d69e1c77577413e /src/fdevent_freebsd_kqueue.c
parente45388fc446e52d968630b677bccb445d9d692fa (diff)
downloadlighttpd1.4-478053510bac72960b77cb68b3a5b167f3c8d6cd.tar.gz
lighttpd1.4-478053510bac72960b77cb68b3a5b167f3c8d6cd.zip
only try to open the event-handler, but close right away as we have to open it AFTER the daemonize again
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@665 152afb58-edef-0310-8abb-c4023f1b3aa9
Diffstat (limited to 'src/fdevent_freebsd_kqueue.c')
-rw-r--r--src/fdevent_freebsd_kqueue.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/fdevent_freebsd_kqueue.c b/src/fdevent_freebsd_kqueue.c
index 1f6a6fcb..b9557269 100644
--- a/src/fdevent_freebsd_kqueue.c
+++ b/src/fdevent_freebsd_kqueue.c
@@ -181,6 +181,18 @@ int fdevent_freebsd_kqueue_init(fdevents *ev) {
ev->kq_results = calloc(ev->maxfds, sizeof(*ev->kq_results));
ev->kq_bevents = bitset_init(ev->maxfds);
+ /* check that kqueue works */
+
+ if (-1 == (ev->kq_fd = kqueue())) {
+ fprintf(stderr, "%s.%d: kqueue failed (%s), try to set server.event-handler = \"poll\" or \"select\"\n",
+ __FILE__, __LINE__, strerror(errno));
+
+ return -1;
+ }
+
+ close(ev->kq_fd);
+ ev->kq_fd = -1;
+
return 0;
}
#else