netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iproute2] tc/action: print error to stderr
@ 2022-01-20 21:06 Stephen Hemminger
  2022-01-20 21:10 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Hemminger @ 2022-01-20 21:06 UTC (permalink / raw)
  To: netdev; +Cc: Stephen Hemminger, jiri

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 | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/tc/m_action.c b/tc/m_action.c
index b16882a345dc..ee32aeda98fd 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();
 		}
 
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-01-20 21:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-20 21:06 [PATCH iproute2] tc/action: print error to stderr Stephen Hemminger
2022-01-20 21:10 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).