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 | |
| 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')
| -rw-r--r-- | pkg/ipc/ipc_simple.go | 23 | ||||
| -rw-r--r-- | pkg/osutil/osutil.go | 8 |
2 files changed, 10 insertions, 21 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 } diff --git a/pkg/osutil/osutil.go b/pkg/osutil/osutil.go index d98e91e19..46919a6c2 100644 --- a/pkg/osutil/osutil.go +++ b/pkg/osutil/osutil.go @@ -10,7 +10,6 @@ import ( "os" "os/exec" "path/filepath" - "runtime" "time" ) @@ -150,9 +149,6 @@ func ListDir(dir string) ([]string, error) { var wd string func init() { - if runtime.GOOS == "fuchsia" { - return - } var err error wd, err = os.Getwd() if err != nil { @@ -161,10 +157,6 @@ func init() { } func Abs(path string) string { - if runtime.GOOS == "fuchsia" { - // Getwd/Abs are not supported on fuchsia. Let's hope for best. - return path - } if wd1, err := os.Getwd(); err == nil && wd1 != wd { panic("don't mess with wd in a concurrent program") } |
