From 36d1c4540af3ef058d68092e41af05aa4a8c5eca Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 8 Mar 2018 18:48:26 +0100 Subject: all: fix gometalinter warnings Fix typos, non-canonical code, remove dead code, etc. --- pkg/ipc/ipc.go | 11 ++++------- pkg/ipc/ipc_test.go | 10 ---------- 2 files changed, 4 insertions(+), 17 deletions(-) (limited to 'pkg/ipc') diff --git a/pkg/ipc/ipc.go b/pkg/ipc/ipc.go index fbce12efa..104be74d2 100644 --- a/pkg/ipc/ipc.go +++ b/pkg/ipc/ipc.go @@ -528,6 +528,8 @@ type executeReply struct { status uint32 } +// TODO(dvyukov): we currently parse this manually, should cast output to this struct instead. +/* type callReply struct { callIndex uint32 callNum uint32 @@ -539,6 +541,7 @@ type callReply struct { compsSize uint32 // signal/cover/comps follow } +*/ func makeCommand(pid int, bin []string, config *Config, inFile *os.File, outFile *os.File) (*command, error) { dir, err := ioutil.TempDir("./", "syzkaller-testdir") @@ -782,7 +785,7 @@ func (c *command) exec(opts *ExecOpts, progData []byte) (output []byte, failed, hang <- false } }() - exitStatus := 0 + var exitStatus int if c.config.Flags&FlagUseForkServer == 0 { restart = true c.cmd.Wait() @@ -849,9 +852,3 @@ func (c *command) exec(opts *ExecOpts, progData []byte) (output []byte, failed, } return } - -func serializeUint64(buf []byte, v uint64) { - for i := 0; i < 8; i++ { - buf[i] = byte(v >> (8 * uint(i))) - } -} diff --git a/pkg/ipc/ipc_test.go b/pkg/ipc/ipc_test.go index 03de4ebf1..88b124a6f 100644 --- a/pkg/ipc/ipc_test.go +++ b/pkg/ipc/ipc_test.go @@ -13,7 +13,6 @@ import ( "time" "github.com/google/syzkaller/pkg/csource" - "github.com/google/syzkaller/pkg/osutil" "github.com/google/syzkaller/prog" _ "github.com/google/syzkaller/sys" ) @@ -25,15 +24,6 @@ func buildExecutor(t *testing.T, target *prog.Target) string { return buildProgram(t, target, filepath.FromSlash(src)) } -func buildSource(t *testing.T, target *prog.Target, src []byte) string { - tmp, err := osutil.WriteTempFile(src) - if err != nil { - t.Fatalf("%v", err) - } - defer os.Remove(tmp) - return buildProgram(t, target, tmp) -} - func buildProgram(t *testing.T, target *prog.Target, src string) string { bin, err := csource.Build(target, "c++", src) if err != nil { -- cgit mrf-deployment