mirror of
https://github.com/linux-can/can-utils.git
synced 2026-08-05 06:20:00 +02:00
When sending a sequence, we need to resend the same frame when poll() returns.
Fixed that to be a valid data source e.g. for ptx cansequence.
This commit is contained in:
@@ -341,6 +341,7 @@ int main(int argc, char **argv)
|
|||||||
fprint_canframe(stdout, &frame, "\n", 1);
|
fprint_canframe(stdout, &frame, "\n", 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resend:
|
||||||
nbytes = write(s, &frame, sizeof(struct can_frame));
|
nbytes = write(s, &frame, sizeof(struct can_frame));
|
||||||
if (nbytes < 0) {
|
if (nbytes < 0) {
|
||||||
if (errno != ENOBUFS) {
|
if (errno != ENOBUFS) {
|
||||||
@@ -356,7 +357,8 @@ int main(int argc, char **argv)
|
|||||||
if (poll(&fds, 1, polltimeout) < 0) {
|
if (poll(&fds, 1, polltimeout) < 0) {
|
||||||
perror("poll");
|
perror("poll");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
} else
|
||||||
|
goto resend;
|
||||||
} else
|
} else
|
||||||
enobufs_count++;
|
enobufs_count++;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user