diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2018-08-03 16:57:08 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2018-08-03 16:57:08 +0200 |
| commit | 5ff1f9faece0ff7318d05c21a3efd0b44a009ac8 (patch) | |
| tree | 001b588ef2e7dc4c07f6aed6d2dcbed96956dd88 /pkg/csource/csource.go | |
| parent | 534859fe5ab1f42a26c60ed2a58b34176f8920c8 (diff) | |
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.
Diffstat (limited to 'pkg/csource/csource.go')
| -rw-r--r-- | pkg/csource/csource.go | 4 |
1 files changed, 3 insertions, 1 deletions
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) } } |
