Merge pull request #314 from tychoish/fix-ppid-darwin
error earlier on darwin for get parent pid
This commit is contained in:
commit
35c783ec7d
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue