From: Stephen Hemminger <stephen@networkplumber.org>
To: Roi Dayan <roid@nvidia.com>
Cc: <netdev@vger.kernel.org>, Paul Blakey <paulb@nvidia.com>,
David Ahern <dsahern@gmail.com>
Subject: Re: [PATCH iproute2-next v2 1/1] police: Add support for json output
Date: Thu, 3 Jun 2021 08:49:57 -0700 [thread overview]
Message-ID: <20210603084957.7f62c467@hermes.local> (raw)
In-Reply-To: <20210603073345.1479732-1-roid@nvidia.com>
On Thu, 3 Jun 2021 10:33:45 +0300
Roi Dayan <roid@nvidia.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.
next prev parent reply other threads:[~2021-06-03 15:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-03 7:33 [PATCH iproute2-next v2 1/1] police: Add support for json output Roi Dayan
2021-06-03 15:49 ` Stephen Hemminger [this message]
2021-06-03 16:14 ` Roi Dayan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210603084957.7f62c467@hermes.local \
--to=stephen@networkplumber.org \
--cc=dsahern@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=paulb@nvidia.com \
--cc=roid@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.