[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20201226094832.2b12a20e@hermes.local>
Date: Sat, 26 Dec 2020 09:48:32 -0800
From: Stephen Hemminger <stephen@...workplumber.org>
To: Oliver Hartkopp <socketcan@...tkopp.net>
Cc: netdev@...r.kernel.org, linux-can@...r.kernel.org
Subject: Re: [PATCH iproute2 5.11 2/2] iplink_can: fix format output for
details with statistics
On Fri, 25 Dec 2020 20:10:15 +0100
Oliver Hartkopp <socketcan@...tkopp.net> wrote:
> @@ -315,10 +320,12 @@ static void can_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
> "restart_ms",
> "restart-ms %d ",
> *restart_ms);
> }
>
> + fprintf(f, "\n ");
> +
That will print in both JSON and non-JSON mode. You don't want to do that.
It also will break in single-line mode.
The iplink_can code has way too many if (is_json_context()) ...
which can lead to differences in output.
Ideally it should have no instances of "fprintf(f, ..."
Powered by blists - more mailing lists