uloop: ensure SIGCHLD is properly received on mac os x
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
This commit is contained in:
parent
6a8df07590
commit
c2916d7bcc
1 changed files with 6 additions and 0 deletions
6
uloop.c
6
uloop.c
|
@ -57,6 +57,9 @@ static int cur_fd, cur_nfds;
|
||||||
|
|
||||||
int uloop_init(void)
|
int uloop_init(void)
|
||||||
{
|
{
|
||||||
|
struct timespec timeout = { 0, 0 };
|
||||||
|
struct kevent ev = {};
|
||||||
|
|
||||||
if (poll_fd >= 0)
|
if (poll_fd >= 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -64,6 +67,9 @@ int uloop_init(void)
|
||||||
if (poll_fd < 0)
|
if (poll_fd < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
EV_SET(&ev, SIGCHLD, EVFILT_SIGNAL, EV_ADD, 0, 0, 0);
|
||||||
|
kevent(poll_fd, &ev, 1, NULL, 0, &timeout);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue