diff options
Diffstat (limited to 'daemon')
| -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) | |||
| 147 | sigaction(SIGUSR2, &sa, NULL); | 147 | sigaction(SIGUSR2, &sa, NULL); |
| 148 | } | 148 | } |
| 149 | 149 | ||
| 150 | #ifdef __APPLE__ | ||
| 151 | static int ppoll(struct pollfd *fds, nfds_t nfds, const struct timespec *timeout, const sigset_t *sigmask) | ||
| 152 | { | ||
| 153 | int ready; | ||
| 154 | sigset_t origmask; | ||
| 155 | int to = timeout->tv_sec*1000 + timeout->tv_nsec/1000000; | ||
| 156 | |||
| 157 | sigprocmask(SIG_SETMASK, sigmask, &origmask); | ||
| 158 | ready = poll(fds, nfds, to); | ||
| 159 | sigprocmask(SIG_SETMASK, &origmask, NULL); | ||
| 160 | |||
| 161 | return ready; | ||
| 162 | } | ||
| 163 | #endif | ||
| 164 | |||
| 150 | int main_loop(int listenfd) | 165 | int main_loop(int listenfd) |
| 151 | { | 166 | { |
| 152 | int to, cnt, i, dto; | 167 | int to, cnt, i, dto; |
