]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
tc/action: print error to stderr
authorStephen Hemminger <stephen@networkplumber.org>
Thu, 20 Jan 2022 20:45:49 +0000 (12:45 -0800)
committerStephen Hemminger <stephen@networkplumber.org>
Thu, 20 Jan 2022 21:06:09 +0000 (13:06 -0800)
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 <stephen@networkplumber.org>
tc/m_action.c

index b16882a345dc0414f72fa1cd2926f41a9848a07e..ee32aeda98fdbd5b31c8e5629f574ed04c42b14b 100644 (file)
@@ -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();
                }