diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2017-10-12 10:15:22 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2017-10-12 10:16:39 +0200 |
| commit | 95a2bea7956f6346c11577645df96e13fe7fec3d (patch) | |
| tree | ab708dad4566aabe5b10a8bb4bf1e204c9f8c2aa /pkg/ipc | |
| parent | 4dc2659337ed0252583d99acb87ba38fa0083ce4 (diff) | |
pkg/ipc, pkg/osutil: remove filepath.Abs fuchsia workarounds
This claimed to be fixed:
https://fuchsia.atlassian.net/browse/DNO-158
Diffstat (limited to 'pkg/ipc')
| -rw-r--r-- | pkg/ipc/ipc_simple.go | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/pkg/ipc/ipc_simple.go b/pkg/ipc/ipc_simple.go index 1aa9c07a5..4c2ac6925 100644 --- a/pkg/ipc/ipc_simple.go +++ b/pkg/ipc/ipc_simple.go @@ -13,7 +13,6 @@ import ( "os" "os/exec" "path/filepath" - "runtime" "strings" "sync/atomic" "time" @@ -43,18 +42,16 @@ func MakeEnv(bin string, pid int, config Config) (*Env, error) { if len(env.bin) == 0 { return nil, fmt.Errorf("binary is empty string") } - if runtime.GOOS != "fuchsia" { - env.bin[0] = osutil.Abs(env.bin[0]) - base := filepath.Base(env.bin[0]) - pidStr := fmt.Sprint(pid) - if len(base)+len(pidStr) >= 16 { - // TASK_COMM_LEN is currently set to 16 - base = base[:15-len(pidStr)] - } - binCopy := filepath.Join(filepath.Dir(env.bin[0]), base+pidStr) - if err := os.Link(env.bin[0], binCopy); err == nil { - env.bin[0] = binCopy - } + env.bin[0] = osutil.Abs(env.bin[0]) + base := filepath.Base(env.bin[0]) + pidStr := fmt.Sprint(pid) + if len(base)+len(pidStr) >= 16 { + // TASK_COMM_LEN is currently set to 16 + base = base[:15-len(pidStr)] + } + binCopy := filepath.Join(filepath.Dir(env.bin[0]), base+pidStr) + if err := os.Link(env.bin[0], binCopy); err == nil { + env.bin[0] = binCopy } return env, nil } |
