diff mbox series

[iproute2] tc/action: print error to stderr

Message ID 20220120210646.189197-1-stephen@networkplumber.org (mailing list archive)
State Accepted
Commit d542543bb5ec57c7fc50143cef44209feb3a4e7f
Delegated to: David Ahern
Headers show
Series [iproute2] tc/action: print error to stderr | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Stephen Hemminger Jan. 20, 2022, 9:06 p.m. UTC
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(-)

Comments

patchwork-bot+netdevbpf@kernel.org Jan. 20, 2022, 9:10 p.m. UTC | #1
Hello:

This patch was applied to iproute2/iproute2.git (main)
by Stephen Hemminger <stephen@networkplumber.org>:

On Thu, 20 Jan 2022 13:06:46 -0800 you wrote:
> 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(-)

Here is the summary with links:
  - [iproute2] tc/action: print error to stderr
    https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=d542543bb5ec

You are awesome, thank you!
diff mbox series

Patch

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();
 		}