canfdtest: make use of return value of check_frame

check_frame has a return value. Make use of this in can_echo_dut which
then is evaluated and returned thereof in main()

Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
pull/354/head
Philippe Schenker 2022-04-12 17:18:22 +02:00
parent 24de626f33
commit 26842295b8
1 changed files with 3 additions and 2 deletions

View File

@ -264,6 +264,7 @@ static int can_echo_dut(void)
{
unsigned int frame_count = 0;
struct can_frame frame;
int err = 0;
while (running) {
if (recv_frame(&frame))
@ -275,7 +276,7 @@ static int can_echo_dut(void)
print_frame(frame.can_id, frame.data, frame.can_dlc, 0);
}
check_frame(&frame);
err = check_frame(&frame);
inc_frame(&frame);
if (send_frame(&frame))
return -1;
@ -290,7 +291,7 @@ static int can_echo_dut(void)
}
}
return 0;
return err;
}
static int can_echo_gen(void)