[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210603084957.7f62c467@hermes.local>
Date: Thu, 3 Jun 2021 08:49:57 -0700
From: Stephen Hemminger <stephen@...workplumber.org>
To: Roi Dayan <roid@...dia.com>
Cc: <netdev@...r.kernel.org>, Paul Blakey <paulb@...dia.com>,
David Ahern <dsahern@...il.com>
Subject: Re: [PATCH iproute2-next v2 1/1] police: Add support for json
output
On Thu, 3 Jun 2021 10:33:45 +0300
Roi Dayan <roid@...dia.com> wrote:
> if (tb[TCA_POLICE_TBF] == NULL) {
> - fprintf(f, "[NULL police tbf]");
> + print_string(PRINT_FP, NULL, "%s", "[NULL police tbf]");
> return 0;
> }
> #ifndef STOOPID_8BYTE
> if (RTA_PAYLOAD(tb[TCA_POLICE_TBF]) < sizeof(*p)) {
> - fprintf(f, "[truncated police tbf]");
> + print_string(PRINT_FP, NULL, "%s", "[truncated police tbf]");
These are errors, and you should just print them to stderr.
That way if program is using JSON they can see the output on stdout;
and look for non-structured errors on stderr.
Powered by blists - more mailing lists