diff --git a/libs/main/core/piwaitevent_p.cpp b/libs/main/core/piwaitevent_p.cpp index dfb2b23c..47983a5d 100644 --- a/libs/main/core/piwaitevent_p.cpp +++ b/libs/main/core/piwaitevent_p.cpp @@ -89,11 +89,11 @@ bool PIWaitEvent::wait(int fd, CheckRole role) { FD_SET(pipe_fd[ReadEnd], &(fds[CheckRead])); FD_SET(fd, &(fds[CheckExeption])); if (fd_index != CheckExeption) FD_SET(fd, &(fds[fd_index])); - int sr = ::select(nfds, &(fds[CheckRead]), &(fds[CheckWrite]), &(fds[CheckExeption]), nullptr); + int sr = ::select(nfds, &(fds[CheckRead]), &(fds[CheckWrite]), &(fds[CheckExeption]), nullptr); if (sr < 0) return false; + errorClear(); int buf = 0; - while (::read(pipe_fd[ReadEnd], &buf, sizeof(buf)) > 0) - ; + while (::read(pipe_fd[ReadEnd], &buf, sizeof(buf)) > 0) {} // piCout << "wait result" << sr << FD_ISSET(fd, &(fds[CheckExeption])) << FD_ISSET(fd, &(fds[fd_index])); if (errno == EBADF || errno == EINTR) return false; if (FD_ISSET(fd, &(fds[CheckExeption]))) return true;