aboutsummaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorMarco Vanotti <mvanotti@users.noreply.github.com>2019-04-03 15:44:27 -0700
committerJulia Hansbrough <flowerhack@google.com>2019-04-03 15:44:27 -0700
commit26cbbd042aae9311e5c22e0c41523977aa95d451 (patch)
tree542fe421a757d2ed5dadc175d1b3600589fd5676 /pkg
parent4949990eeac542550e992ee3275dccb5079031b4 (diff)
pkg/ipc: use /data/ for storage in fuchsia. (#1101)
We cannot create folders in other directories anymore, for now, we only have access to create directories in /data/. This change is temporary as we move to a component-based world.
Diffstat (limited to 'pkg')
-rw-r--r--pkg/ipc/ipc.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/pkg/ipc/ipc.go b/pkg/ipc/ipc.go
index e1e22445e..1d2c11b42 100644
--- a/pkg/ipc/ipc.go
+++ b/pkg/ipc/ipc.go
@@ -268,8 +268,12 @@ func (env *Env) Exec(opts *ExecOpts, p *prog.Prog) (output []byte, info *ProgInf
// starting them too frequently leads to timeouts.
<-rateLimit.C
}
+ tmpDirPath := "./"
+ if p.Target.OS == "fuchsia" {
+ tmpDirPath = "/data/"
+ }
atomic.AddUint64(&env.StatRestarts, 1)
- env.cmd, err0 = makeCommand(env.pid, env.bin, env.config, env.inFile, env.outFile, env.out)
+ env.cmd, err0 = makeCommand(env.pid, env.bin, env.config, env.inFile, env.outFile, env.out, tmpDirPath)
if err0 != nil {
return
}
@@ -518,8 +522,9 @@ type callReply struct {
// signal/cover/comps follow
}
-func makeCommand(pid int, bin []string, config *Config, inFile, outFile *os.File, outmem []byte) (*command, error) {
- dir, err := ioutil.TempDir("./", "syzkaller-testdir")
+func makeCommand(pid int, bin []string, config *Config, inFile, outFile *os.File, outmem []byte,
+ tmpDirPath string) (*command, error) {
+ dir, err := ioutil.TempDir(tmpDirPath, "syzkaller-testdir")
if err != nil {
return nil, fmt.Errorf("failed to create temp dir: %v", err)
}