| OLD | NEW |
| 1 // Copyright 2017 The LUCI Authors. All rights reserved. | 1 // Copyright 2017 The LUCI Authors. All rights reserved. |
| 2 // Use of this source code is governed under the Apache License, Version 2.0 | 2 // Use of this source code is governed under the Apache License, Version 2.0 |
| 3 // that can be found in the LICENSE file. | 3 // that can be found in the LICENSE file. |
| 4 | 4 |
| 5 // +build darwin linux freebsd netbsd openbsd android | 5 // +build darwin linux freebsd netbsd openbsd android |
| 6 | 6 |
| 7 package venv | 7 package venv |
| 8 | 8 |
| 9 import ( | 9 import ( |
| 10 "os" | 10 "os" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 } | 21 } |
| 22 | 22 |
| 23 // venvBinDir resolves the path where VirtualEnv binaries are installed. | 23 // venvBinDir resolves the path where VirtualEnv binaries are installed. |
| 24 func venvBinDir(root string) string { | 24 func venvBinDir(root string) string { |
| 25 return filepath.Join(root, "bin") | 25 return filepath.Join(root, "bin") |
| 26 } | 26 } |
| 27 | 27 |
| 28 func checkProcessRunning(pid int) error { | 28 func checkProcessRunning(pid int) error { |
| 29 proc, err := os.FindProcess(pid) | 29 proc, err := os.FindProcess(pid) |
| 30 if err != nil { | 30 if err != nil { |
| 31 » » return errors.Annotate(err).Reason("failed to find process").Err
() | 31 » » return errors.Annotate(err, "failed to find process").Err() |
| 32 } | 32 } |
| 33 | 33 |
| 34 if err := proc.Signal(os.Signal(syscall.Signal(0))); err != nil { | 34 if err := proc.Signal(os.Signal(syscall.Signal(0))); err != nil { |
| 35 » » return errors.Annotate(err).Reason("failed to signal process").E
rr() | 35 » » return errors.Annotate(err, "failed to signal process").Err() |
| 36 } | 36 } |
| 37 return nil | 37 return nil |
| 38 } | 38 } |
| OLD | NEW |