diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2006-08-16 10:54:06 +0000 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2006-08-16 10:54:06 +0000 |
commit | a1bc48d15a5d6e78efe744eb7b27b6421cb7222f (patch) | |
tree | a7880f87c2585311975e4087d36255c9f1f0b7ec /hidd/fakehid.c | |
parent | a23442be507d9384175898a28fb72c35f790fbd1 (diff) |
Convert to using ppoll() and pselect()
Diffstat (limited to 'hidd/fakehid.c')
-rw-r--r-- | hidd/fakehid.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/hidd/fakehid.c b/hidd/fakehid.c index 91a62fb3..70eba3b4 100644 --- a/hidd/fakehid.c +++ b/hidd/fakehid.c @@ -25,6 +25,7 @@ #include <config.h> #endif +#define _GNU_SOURCE #include <stdio.h> #include <errno.h> #include <fcntl.h> @@ -44,6 +45,10 @@ #include <math.h> +#ifdef NEED_PPOLL +#include "ppoll.h" +#endif + static void event(int fd, uint16_t type, uint16_t code, int32_t value) { struct uinput_event event; @@ -282,6 +287,7 @@ int epox_presenter(const bdaddr_t *src, const bdaddr_t *dst, uint8_t channel) unsigned char buf[16]; struct sigaction sa; struct pollfd p; + sigset_t sigs; char addr[18]; int i, fd, sk, len; @@ -313,12 +319,14 @@ int epox_presenter(const bdaddr_t *src, const bdaddr_t *dst, uint8_t channel) sa.sa_handler = sig_hup; sigaction(SIGHUP, &sa, NULL); + sigfillset(&sigs); + p.fd = sk; p.events = POLLIN | POLLERR | POLLHUP; while (!__io_canceled) { p.revents = 0; - if (poll(&p, 1, 500) < 1) + if (ppoll(&p, 1, NULL, &sigs) < 1) continue; len = read(sk, buf, sizeof(buf)); |