Skip to content

Commit 1b4e317

Browse files
candump: fix epoll_wait() returning -1, errno == -EINTR
-EINTR is not an error, just restart the syscall. Fixes: 639498b ("candump: use epoll_wait() instead of select()") Link: #296 Reported-by: Joakim Zhang <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
1 parent f8a2cf0 commit 1b4e317

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

candump.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -690,10 +690,10 @@ int main(int argc, char **argv)
690690
msg.msg_control = &ctrlmsg;
691691

692692
while (running) {
693-
694-
if ((num_events = epoll_wait(fd_epoll, events_pending, currmax, timeout_ms)) <= 0) {
695-
//perror("epoll_wait");
696-
running = 0;
693+
num_events = epoll_wait(fd_epoll, events_pending, currmax, timeout_ms);
694+
if (num_events == -1) {
695+
if (errno != EINTR)
696+
running = 0;
697697
continue;
698698
}
699699

0 commit comments

Comments
 (0)