Skip to contentSkip to conversation

tc/action: print error to stderr

PATCH Applied Stephen Hemminger 2 participants 2 messages Jan 20, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tc/action: print error to stderr

Error messages should go to stderr even if using JSON.

Fixes 2704bd625583 ("tc: jsonify actions core")
---
 tc/m_action.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
tc/m_action.c +2 -4
index b16882a345dc..ee32aeda98fd 100644
@@ -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();
 		}
 
Signature · 1 line
2.30.2
#1 lore raw
This patch was applied to iproute2/iproute2.git (main) by Stephen Hemminger <[email protected]>:

Hello:

This patch was applied to iproute2/iproute2.git (main) by Stephen Hemminger <[email protected]>:

Quoted 8 lines · 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")
---
 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!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html