From: Stephen Hemminger Date: Thu, 20 Jan 2022 20:45:49 +0000 (-0800) Subject: tc/action: print error to stderr X-Git-Tag: v5.17.0~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d542543bb5ec57c7fc50143cef44209feb3a4e7f;p=thirdparty%2Fiproute2.git tc/action: print error to stderr Error messages should go to stderr even if using JSON. Fixes: 2704bd625583 ("tc: jsonify actions core") Cc: jiri@mellanox.com Signed-off-by: Stephen Hemminger --- diff --git a/tc/m_action.c b/tc/m_action.c index b16882a34..ee32aeda9 100644 --- a/tc/m_action.c +++ b/tc/m_action.c @@ -466,10 +466,8 @@ tc_print_action(FILE *f, const struct rtattr *arg, unsigned short tot_acts) print_nl(); print_uint(PRINT_ANY, "order", "\taction order %u: ", i); - if (tc_print_one_action(f, tb[i]) < 0) { - print_string(PRINT_FP, NULL, - "Error printing action\n", NULL); - } + if (tc_print_one_action(f, tb[i]) < 0) + fprintf(stderr, "Error printing action\n"); close_json_object(); }