From: Vincent Mailhol Date: Tue, 12 Nov 2024 17:27:54 +0000 (+0900) Subject: iplink_can: use invarg() instead of fprintf() X-Git-Tag: v6.13.0~15^2~2^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=68aaea862838bdaae5dcf3905188b97fcee32cbd;p=thirdparty%2Fiproute2.git iplink_can: use invarg() instead of fprintf() invarg() is specifically designed to print error messages when an invalid argument is provided. Replace the generic fprintf() by invarg() in can_parse_opt(). Signed-off-by: Vincent Mailhol Signed-off-by: David Ahern --- diff --git a/ip/iplink_can.c b/ip/iplink_can.c index 6c6fcf61..928d5d79 100644 --- a/ip/iplink_can.c +++ b/ip/iplink_can.c @@ -254,10 +254,8 @@ static int can_parse_opt(struct link_util *lu, int argc, char **argv, cm.mask |= CAN_CTRLMODE_TDC_AUTO | CAN_CTRLMODE_TDC_MANUAL; } else { - fprintf(stderr, - "Error: argument of \"tdc-mode\" must be \"auto\", \"manual\" or \"off\", not \"%s\"\n", + invarg("\"tdc-mode\" must be either of \"auto\", \"manual\" or \"off\"", *argv); - exit (-1); } } else if (matches(*argv, "restart") == 0) { __u32 val = 1;