Skip to contentSkip to conversation

tools/bpftool: fix skeleton codegen

PATCH Applied Andrii Nakryiko 3 participants 3 messages Jun 12, 2020

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

PATCH 1/1 tools/bpftool: fix skeleton codegen

Remove unnecessary check at the end of codegen() routine which makes codegen() to always fail and exit bpftool with error code. Positive value of variable n is not an indicator of a failure.

Cc Tobias Klauser <[email protected]>
Fixes 2c4779eff837 ("tools, bpftool: Exit on error in function codegen")
---
 tools/bpf/bpftool/gen.c | 2 --
 1 file changed, 2 deletions(-)
tools/bpf/bpftool/gen.c +0 -2
index 7443879e87af..10de76b296ba 100644
@@ -257,8 +257,6 @@ static void codegen(const char *template, ...)
 	va_end(args);
 
 	free(s);
-	if (n)
-		exit(-1);
 }
 
 static int do_skeleton(int argc, char **argv)
Signature · 1 line
2.24.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Andrii Nakryiko

Remove unnecessary check at the end of codegen() routine which makes codegen() to always fail and exit bpftool with error code. Positive value of variable n is not an indicator of a failure.

Cc Tobias Klauser <[email protected]>
Fixes 2c4779eff837 ("tools, bpftool: Exit on error in function codegen")

Sorry about this, thanks for fixing it.

#2 lore raw
Quoted 6 lines · Tobias Klauser
Quoted 4 lines · Andrii Nakryiko

Remove unnecessary check at the end of codegen() routine which makes codegen() to always fail and exit bpftool with error code. Positive value of variable n is not an indicator of a failure.

Quoted 7 lines
Quoted 3 lines
Cc Tobias Klauser <[email protected]>
Fixes 2c4779eff837 ("tools, bpftool: Exit on error in function codegen")

Sorry about this, thanks for fixing it.

Applied. Thanks