From 98cf375d694e7ae4b28f3b8aebfdef432dedab8d Mon Sep 17 00:00:00 2001 From: hartkopp Date: Fri, 26 Feb 2010 08:38:47 +0000 Subject: [PATCH] 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. git-svn-id: svn://svn.berlios.de//socketcan/trunk@1148 030b6a49-0b11-0410-94ab-b0dab22257f2 --- can-utils/cangen.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/can-utils/cangen.c b/can-utils/cangen.c index df6b77f..898068b 100644 --- a/can-utils/cangen.c +++ b/can-utils/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++; -- 2.39.2