aboutsummaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2017-09-27 11:45:43 +0200
committerDmitry Vyukov <dvyukov@google.com>2017-09-27 18:59:50 +0200
commit6350e5c2cfea0567cfd6f0e11ed3b8352fdfe8e8 (patch)
treefbcf1f491ed086d80fad824abf9f30724a4301c8 /pkg
parentbdffe2484cfffefd2f3321cb42890be70887cf44 (diff)
pkg/ipc: fix windows
Abs does not work on fuchsia only, use it on windows. Also maintain stats.
Diffstat (limited to 'pkg')
-rw-r--r--pkg/ipc/ipc_simple.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/pkg/ipc/ipc_simple.go b/pkg/ipc/ipc_simple.go
index 9e5c52b8c..445c44c07 100644
--- a/pkg/ipc/ipc_simple.go
+++ b/pkg/ipc/ipc_simple.go
@@ -13,7 +13,9 @@ import (
"os"
"os/exec"
"path/filepath"
+ "runtime"
"strings"
+ "sync/atomic"
"time"
"github.com/google/syzkaller/pkg/osutil"
@@ -41,7 +43,7 @@ func MakeEnv(bin string, pid int, config Config) (*Env, error) {
if len(env.bin) == 0 {
return nil, fmt.Errorf("binary is empty string")
}
- if false {
+ if runtime.GOOS != "fuchsia" {
env.bin[0] = osutil.Abs(env.bin[0])
base := filepath.Base(env.bin[0])
pidStr := fmt.Sprint(pid)
@@ -62,6 +64,7 @@ func (env *Env) Close() error {
}
func (env *Env) Exec(opts *ExecOpts, p *prog.Prog) (output []byte, info []CallInfo, failed, hanged bool, err0 error) {
+ atomic.AddUint64(&env.StatExecs, 1)
dir, err := ioutil.TempDir("./", "syzkaller-testdir")
if err != nil {
err0 = fmt.Errorf("failed to create temp dir: %v", err)