diff --git a/res/res_timing_pthread.c b/res/res_timing_pthread.c index 53ceeb5de7..f6be638829 100644 --- a/res/res_timing_pthread.c +++ b/res/res_timing_pthread.c @@ -36,6 +36,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$"); #include "asterisk/astobj2.h" #include "asterisk/time.h" #include "asterisk/lock.h" +#include "asterisk/poll-compat.h" static void *timing_funcs_handle; @@ -376,16 +377,12 @@ static void read_pipe(struct pthread_timer *timer, unsigned int quantity) 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;