diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2018-03-08 18:48:26 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2018-03-08 18:48:26 +0100 |
| commit | 36d1c4540af3ef058d68092e41af05aa4a8c5eca (patch) | |
| tree | 3657a5920e4b100749ccb9d2d555652e7b7e28e9 /pkg/ipc | |
| parent | 63ef857906766b3cafe4aebc43bc38edf42096c3 (diff) | |
all: fix gometalinter warnings
Fix typos, non-canonical code, remove dead code, etc.
Diffstat (limited to 'pkg/ipc')
| -rw-r--r-- | pkg/ipc/ipc.go | 11 | ||||
| -rw-r--r-- | pkg/ipc/ipc_test.go | 10 |
2 files changed, 4 insertions, 17 deletions
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 { |
