diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2017-09-24 11:13:37 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2017-09-25 15:19:06 +0200 |
| commit | af442a22d956464e7df703b290fa49d78dda3dfa (patch) | |
| tree | b50403630f29373cfb711a711fbfd24d632ce2ba /sys/syz-extract/fuchsia.go | |
| parent | 255e8b5e54e93fc77302a546dbb7a932412d1bde (diff) | |
executor, sys/windows: initial windows support
Diffstat (limited to 'sys/syz-extract/fuchsia.go')
| -rw-r--r-- | sys/syz-extract/fuchsia.go | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/sys/syz-extract/fuchsia.go b/sys/syz-extract/fuchsia.go index 1d3405ba8..f3cab132f 100644 --- a/sys/syz-extract/fuchsia.go +++ b/sys/syz-extract/fuchsia.go @@ -9,7 +9,6 @@ import ( "os" "os/exec" "path/filepath" - "strconv" "strings" "github.com/google/syzkaller/pkg/compiler" @@ -18,6 +17,9 @@ import ( type fuchsia struct{} func (*fuchsia) prepare(sourcedir string, build bool, arches []string) error { + if sourcedir == "" { + return fmt.Errorf("provide path to kernel checkout via -sourcedir flag (or make extract SOURCEDIR)") + } return nil } @@ -31,26 +33,9 @@ func (*fuchsia) processFile(arch *Arch, info *compiler.ConstInfo) (map[string]ui return nil, nil, fmt.Errorf("failed to run compiler: %v\n%v", err, string(out)) } defer os.Remove(bin) - - out, err = exec.Command(bin).CombinedOutput() + res, err := runBinaryAndParse(bin, info.Consts, nil) if err != nil { - return nil, nil, fmt.Errorf("failed to run compiled binary: %v\n%v", err, string(out)) - } - - flagVals := strings.Split(string(out), " ") - if len(out) == 0 { - flagVals = nil - } - if len(flagVals) != len(info.Consts) { - return nil, nil, fmt.Errorf("fetched wrong number of values %v, want %v", len(flagVals), len(info.Consts)) - } - res := make(map[string]uint64) - for i, v := range flagVals { - n, err := strconv.ParseUint(v, 10, 64) - if err != nil { - return nil, nil, fmt.Errorf("failed to parse value: %v (%v)", err, v) - } - res[info.Consts[i]] = n + return nil, nil, err } return res, nil, nil } |
