diff options
| author | 2010-03-29 22:45:27 +0200 | |
|---|---|---|
| committer | 2010-04-08 15:11:28 +0200 | |
| commit | c310eb77480ca24dfdeefd80b73318ef890b5e2a (patch) | |
| tree | c1bbeb4d5db049aebf4ea9775f36a7d14363cbbc /daemon/main.c | |
| parent | 3013889a86dff1fcc6260b476dc30824b71b0562 (diff) | |
| download | usbmuxd-c310eb77480ca24dfdeefd80b73318ef890b5e2a.tar.gz usbmuxd-c310eb77480ca24dfdeefd80b73318ef890b5e2a.tar.bz2 | |
OSX: add workaround for missing ppoll system call
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) | |||
| 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; |
