Use the select() function instead of poll().
The poll() function does not support (serial) devices on Mac OS X.
This commit is contained in:
parent
4be1c33ca3
commit
4d30b19251
@ -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
|
// reading/writing when a call to an input/output function with
|
||||||
// O_NONBLOCK clear would not block, whether or not the function
|
// O_NONBLOCK clear would not block, whether or not the function
|
||||||
// would transfer data successfully.
|
// would transfer data successfully.
|
||||||
/*
|
|
||||||
fd_set fds;
|
fd_set fds;
|
||||||
FD_ZERO (&fds);
|
FD_ZERO (&fds);
|
||||||
FD_SET (fd, &fds);
|
FD_SET (fd, &fds);
|
||||||
@ -420,11 +420,6 @@ posix_wait (int fd, const struct timeouts_t* timeouts, int input, unsigned int a
|
|||||||
else
|
else
|
||||||
rc = select (fd + 1, NULL, &fds, NULL, NULL);
|
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);
|
} while (rc < 0 && errno == EINTR);
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user