From: Felix Fietkau Date: Fri, 4 Jan 2013 02:13:29 +0000 (+0100) Subject: uloop: ensure SIGCHLD is properly received on mac os x X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=c2916d7bcca129152fbbbbedcd9990706df8760a;p=oweals%2Flibubox.git uloop: ensure SIGCHLD is properly received on mac os x Signed-off-by: Felix Fietkau --- diff --git a/uloop.c b/uloop.c index 2de94f5..bf17219 100644 --- a/uloop.c +++ b/uloop.c @@ -57,6 +57,9 @@ static int cur_fd, cur_nfds; int uloop_init(void) { + struct timespec timeout = { 0, 0 }; + struct kevent ev = {}; + if (poll_fd >= 0) return 0; @@ -64,6 +67,9 @@ int uloop_init(void) if (poll_fd < 0) return -1; + EV_SET(&ev, SIGCHLD, EVFILT_SIGNAL, EV_ADD, 0, 0, 0); + kevent(poll_fd, &ev, 1, NULL, 0, &timeout); + return 0; }