From: Oliver Hartkopp Date: Fri, 26 Feb 2010 08:38:47 +0000 (+0000) Subject: When sending a sequence, we need to resend the same frame when poll() returns. X-Git-Url: https://rtime.felk.cvut.cz/gitweb/sojka/can-utils.git/commitdiff_plain/afa14f102dfd8f1f17f512e2aa3c6b0e9883626d 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. --- diff --git a/cangen.c b/cangen.c index df6b77f..898068b 100644 --- a/cangen.c +++ b/cangen.c @@ -341,6 +341,7 @@ int main(int argc, char **argv) fprint_canframe(stdout, &frame, "\n", 1); } +resend: nbytes = write(s, &frame, sizeof(struct can_frame)); if (nbytes < 0) { if (errno != ENOBUFS) { @@ -356,7 +357,8 @@ int main(int argc, char **argv) if (poll(&fds, 1, polltimeout) < 0) { perror("poll"); return 1; - } + } else + goto resend; } else enobufs_count++;