[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87lffmhywx.fsf@nvidia.com>
Date: Sat, 31 Oct 2020 22:24:14 +0100
From: Petr Machata <me@...chata.org>
To: Stephen Hemminger <stephen@...workplumber.org>
Cc: netdev@...r.kernel.org, dsahern@...il.com,
john.fastabend@...il.com, jiri@...dia.com, idosch@...dia.com,
Jakub Kicinski <kuba@...nel.org>,
"Roman Mashak" <mrv@...atatu.com>
Subject: Re: [PATCH iproute2-next v2 03/11] lib: utils: Add print_on_off_bool()
Stephen Hemminger <stephen@...workplumber.org> writes:
> On Fri, 30 Oct 2020 13:29:50 +0100
> Petr Machata <me@...chata.org> wrote:
>
>> +void print_on_off_bool(FILE *fp, const char *flag, bool val)
>> +{
>> + if (is_json_context())
>> + print_bool(PRINT_JSON, flag, NULL, val);
>> + else
>> + fprintf(fp, "%s %s ", flag, val ? "on" : "off");
>> +}
>
> Please use print_string(PRINT_FP for non json case.
> I am use fprintf(fp as indicator for code that has not been already
> converted to JSON.
>
> And passing the FILE *fp is also indication of old code.
> Original iproute2 passed it around but it was always stdout.
Ack, will fix.
Powered by blists - more mailing lists