- int fd = m_statusMonitor.getFd();
- fd_set fds;
- timeval tv;
- FD_ZERO(&fds);
- FD_SET(fd, &fds);
- tv.tv_sec = timeoutSeconds;
- tv.tv_usec = 0;
-
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wrestrict"
-
- int ret;
- if (m_statusMonitor.getStatus() == READ)
- ret = TEMP_FAILURE_RETRY(select(fd + 1, &fds, NULL, NULL, &tv));
- else
- ret = TEMP_FAILURE_RETRY(select(fd + 1, &fds, &fds, NULL, &tv));
+ pollfd fds[1];
+ fds->fd = m_statusMonitor.getFd();
+ fds->events = POLLIN | (m_statusMonitor.getStatus() == READ ? 0 : POLLOUT);
+ int ret = TEMP_FAILURE_RETRY(poll(fds, 1, timeoutSeconds * 1000));