#include "asterisk/astobj2.h"
#include "asterisk/time.h"
#include "asterisk/lock.h"
+#include "asterisk/poll-compat.h"
static void *timing_funcs_handle;
do {
unsigned char buf[1024];
ssize_t res;
- fd_set rfds;
- struct timeval timeout = {
- .tv_sec = 0,
+ struct pollfd pfd = {
+ .fd = rd_fd,
+ .events = POLLIN,
};
- /* Make sure there is data to read */
- FD_ZERO(&rfds);
- FD_SET(rd_fd, &rfds);
-
- if (select(rd_fd + 1, &rfds, NULL, NULL, &timeout) != 1) {
+ if (ast_poll(&pfd, 1, 0) != 1) {
ast_debug(1, "Reading not available on timing pipe, "
"quantity: %u\n", quantity);
break;