diff --git a/lib/kc3/0.1/httpd.kc3 b/lib/kc3/0.1/httpd.kc3
index fb7ec6d..ad19859 100644
--- a/lib/kc3/0.1/httpd.kc3
+++ b/lib/kc3/0.1/httpd.kc3
@@ -75,13 +75,13 @@ defmodule HTTPd do
def timeout = %Time{}
def server = fn (host, port) {
+ daemonize()
event_base = Event.base_new()
socket = Socket.listen(host, port)
puts("KC3 HTTPd: listening on #{host}:#{port}")
acceptor_ev = Event.new(event_base, socket.fd, [:read, :persist],
acceptor, void)
r = Event.add(acceptor_ev, timeout)
- daemonize()
r = Event.dispatch(event_base)
if r do
e = errno()