Merge pull request #314 from tychoish/fix-ppid-darwin

error earlier on darwin for get parent pid
This commit is contained in:
shirou 2017-02-15 10:43:17 +09:00 committed by GitHub
commit 35c783ec7d
1 changed files with 4 additions and 0 deletions

View File

@ -64,6 +64,10 @@ func Pids() ([]int32, error) {
func (p *Process) Ppid() (int32, error) {
r, err := callPs("ppid", p.Pid, false)
if err != nil {
return 0, err
}
v, err := strconv.Atoi(r[0][0])
if err != nil {
return 0, err