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
parent
ad250a68dc
commit
5e0895981b
|
|
@ -708,6 +708,12 @@ int main(int argc, char **argv)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* handle timeout */
|
||||||
|
if (!num_events && timeout_ms >= 0) {
|
||||||
|
running = 0;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < num_events; i++) { /* check waiting CAN RAW sockets */
|
for (i = 0; i < num_events; i++) { /* check waiting CAN RAW sockets */
|
||||||
struct if_info* obj = events_pending[i].data.ptr;
|
struct if_info* obj = events_pending[i].data.ptr;
|
||||||
int idx;
|
int idx;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue