Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.openwrt.org/project/libubox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2013-01-04 06:13:29 +0400
committerFelix Fietkau <nbd@openwrt.org>2013-01-04 06:13:29 +0400
commitc2916d7bcca129152fbbbbedcd9990706df8760a (patch)
tree1b1f07d0a20dfa6c2cb6e34a353ed1860059d294 /uloop.c
parent6a8df07590227de8701d54f20f2331a9ba5030d1 (diff)
uloop: ensure SIGCHLD is properly received on mac os x
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Diffstat (limited to 'uloop.c')
-rw-r--r--uloop.c6
1 files changed, 6 insertions, 0 deletions
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;
}