From 4d30b19251b4bcfb121ea96dde2115f94bc3997a Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Fri, 15 Feb 2008 15:57:45 +0000 Subject: [PATCH] Use the select() function instead of poll(). The poll() function does not support (serial) devices on Mac OS X. --- serial_posix.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/serial_posix.c b/serial_posix.c index 9a23c9f..8d6a2bd 100644 --- a/serial_posix.c +++ b/serial_posix.c @@ -402,7 +402,7 @@ posix_wait (int fd, const struct timeouts_t* timeouts, int input, unsigned int a // reading/writing when a call to an input/output function with // O_NONBLOCK clear would not block, whether or not the function // would transfer data successfully. -/* + fd_set fds; FD_ZERO (&fds); FD_SET (fd, &fds); @@ -420,11 +420,6 @@ posix_wait (int fd, const struct timeouts_t* timeouts, int input, unsigned int a else rc = select (fd + 1, NULL, &fds, NULL, NULL); } -*/ - struct pollfd pfd = {0}; - pfd.fd = fd; - pfd.events = (input ? POLLIN : POLLOUT); - rc = poll (&pfd, 1, timeout); } while (rc < 0 && errno == EINTR); return rc;