From 5ff1f9faece0ff7318d05c21a3efd0b44a009ac8 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Fri, 3 Aug 2018 16:57:08 +0200 Subject: pkg/csource: minor fixes 1. Print errno with %u instead of %d 2. Avoid unused var warning for syz_emit_ethernet when tracing is enabled. --- pkg/csource/csource.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'pkg') diff --git a/pkg/csource/csource.go b/pkg/csource/csource.go index 06bfd5d40..0b3793afd 100644 --- a/pkg/csource/csource.go +++ b/pkg/csource/csource.go @@ -189,6 +189,8 @@ func (ctx *context) generateCalls(p prog.ExecProg, trace bool) ([]string, []uint // However, simply skipping whole iteration breaks tests due to unused static functions. if emitCall { ctx.emitCall(w, call, ci, resCopyout || argCopyout, trace) + } else if trace { + fmt.Fprintf(w, "\t(void)res;\n") } // Copyout. @@ -239,7 +241,7 @@ func (ctx *context) emitCall(w *bytes.Buffer, call prog.ExecCall, ci int, haveCo } fmt.Fprintf(w, ");\n") if trace { - fmt.Fprintf(w, "\tprintf(\"### call=%v errno=%%d\\n\", res == -1 ? errno : 0);\n", ci) + fmt.Fprintf(w, "\tprintf(\"### call=%v errno=%%u\\n\", res == -1 ? errno : 0);\n", ci) } } -- cgit mrf-deployment