diff --git a/src/main.c b/src/main.c index 3601b48..6f2bd0a 100644 --- a/src/main.c +++ b/src/main.c @@ -118,6 +118,8 @@ void read_can(Tel *t, int soc) { struct can_frame frame; int nbytes = read(soc, &frame, sizeof(struct can_frame)); + if (nbytes < 0) return; // -1 EAGAIN means empty + if (nbytes > 0) { switch (frame.can_id) {