candump: fix epoll_wait() returning -1, errno == -EINTR

-EINTR is not an error, just restart the syscall.

Fixes: 639498bc80 ("candump: use epoll_wait() instead of select()")
Link: https://github.com/linux-can/can-utils/issues/296
Reported-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
pull/297/head
Marc Kleine-Budde 2021-05-28 11:47:20 +02:00
parent f8a2cf01fa
commit 1b4e317083
1 changed files with 4 additions and 4 deletions

View File

@ -690,9 +690,9 @@ int main(int argc, char **argv)
msg.msg_control = &ctrlmsg; msg.msg_control = &ctrlmsg;
while (running) { while (running) {
num_events = epoll_wait(fd_epoll, events_pending, currmax, timeout_ms);
if ((num_events = epoll_wait(fd_epoll, events_pending, currmax, timeout_ms)) <= 0) { if (num_events == -1) {
//perror("epoll_wait"); if (errno != EINTR)
running = 0; running = 0;
continue; continue;
} }