candump: fix accidentally disabled traffic timeout feature

With the option '-T <msecs>' candump terminates after getting no CAN traffic
for a specific time. With the introduction of epoll_wait() this feature
has been accidentally disabled.

This patch adds an extra check to detect the timeout again.

Fixes: 639498bc80 ("candump: use epoll_wait() instead of select()")
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
pull/351/head
Oliver Hartkopp 2022-03-07 10:18:21 +01:00
parent ad250a68dc
commit 5e0895981b
1 changed files with 6 additions and 0 deletions

View File

@ -708,6 +708,12 @@ int main(int argc, char **argv)
continue;
}
/* handle timeout */
if (!num_events && timeout_ms >= 0) {
running = 0;
continue;
}
for (i = 0; i < num_events; i++) { /* check waiting CAN RAW sockets */
struct if_info* obj = events_pending[i].data.ptr;
int idx;