diff options
Diffstat (limited to 'daemon/main.c')
-rw-r--r-- | daemon/main.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/daemon/main.c b/daemon/main.c index 18b28a8..d8ae703 100644 --- a/daemon/main.c +++ b/daemon/main.c @@ -147,6 +147,21 @@ void set_signal_handlers(void) sigaction(SIGUSR2, &sa, NULL); } +#ifdef __APPLE__ +static int ppoll(struct pollfd *fds, nfds_t nfds, const struct timespec *timeout, const sigset_t *sigmask) +{ + int ready; + sigset_t origmask; + int to = timeout->tv_sec*1000 + timeout->tv_nsec/1000000; + + sigprocmask(SIG_SETMASK, sigmask, &origmask); + ready = poll(fds, nfds, to); + sigprocmask(SIG_SETMASK, &origmask, NULL); + + return ready; +} +#endif + int main_loop(int listenfd) { int to, cnt, i, dto; |