fix: poll compile error

This commit is contained in:
Livox-SDK
2021-04-20 12:16:38 +08:00
parent 7cf759a760
commit 94a0c7674a
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -41,7 +41,7 @@
#define HAVE_KQUEUE 1 #define HAVE_KQUEUE 1
#else #else
#include <sys/poll.h> #include <sys/poll.h>
#define HAVE POLL 1 #define HAVE_POLL 1
#endif #endif
#endif // CONFIG_H_ #endif // CONFIG_H_
@@ -93,10 +93,10 @@ void MultipleIOPoll:: Poll(int time_out) {
for (int i = 0; i < pollset_num_; i++) { for (int i = 0; i < pollset_num_; i++) {
FdEvent fd_event = NONE_EVENT; FdEvent fd_event = NONE_EVENT;
if (pollset_[i].revents & POLLIN) { if (pollset_[i].revents & POLLIN) {
fd_event = | READBLE_EVENT; fd_event |= READBLE_EVENT;
} }
if (pollset_[i].revents & POLLOUT) { if (pollset_[i].revents & POLLOUT) {
fd_event = | WRITABLE_EVENT; fd_event |= WRITABLE_EVENT;
} }
int fd = pollset_[i].fd; int fd = pollset_[i].fd;
if (descriptors_.find(fd) != descriptors_.end()) { if (descriptors_.find(fd) != descriptors_.end()) {