From e7c03ee93bf054d6cebd04d168f2a0eb59aaa46a Mon Sep 17 00:00:00 2001 From: Marc Kleine-Budde Date: Tue, 19 Sep 2023 08:55:53 +0200 Subject: [PATCH 1/2] cansequence: do_receive(): fix error message if recvmsg() fails In commit 9567230494ea ("cansequence: print out dropped packages by socket counter"), the read() syscall was replaced by recvmsg(). Adjust error message accordingly. Fixes: 9567230494ea ("cansequence: print out dropped packages by socket counter") --- cansequence.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cansequence.c b/cansequence.c index ab635f5..f4f3789 100644 --- a/cansequence.c +++ b/cansequence.c @@ -125,7 +125,7 @@ static void do_receive() nbytes = recvmsg(s, &msg, 0); if (nbytes < 0) { - perror("read()"); + perror("recvmsg()"); exit(EXIT_FAILURE); } From c8cf342cb22bccb2ddb596edd7ef526531223200 Mon Sep 17 00:00:00 2001 From: Marc Kleine-Budde Date: Tue, 19 Sep 2023 08:57:44 +0200 Subject: [PATCH 2/2] cansequence: main(): error handling: add "()" to function name in error message Commit 0be066bee617 ("cansequence: main(): allow to bind on "any" interface") converted from SIOCGIFINDEX ioctl() to if_nametoindex() and adjusted the error message, but forgot the "()" after the function name, which is used in the rest of the error messages in this file. Add the missing "()". Fixes: 0be066bee617 ("cansequence: main(): allow to bind on "any" interface") --- cansequence.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cansequence.c b/cansequence.c index f4f3789..cb3d839 100644 --- a/cansequence.c +++ b/cansequence.c @@ -347,7 +347,7 @@ int main(int argc, char **argv) if (strcmp(ANYDEV, interface)) { addr.can_ifindex = if_nametoindex(interface); if (!addr.can_ifindex) { - perror("if_nametoindex"); + perror("if_nametoindex()"); exit(EXIT_FAILURE); } }