From a4387d0c9224018e208db958e53d387c833430c3 Mon Sep 17 00:00:00 2001 From: Shannon Wynter Date: Mon, 18 Apr 2016 14:38:24 +1000 Subject: [PATCH] emulate original behaviour --- process/process_linux.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/process/process_linux.go b/process/process_linux.go index 4769047..adc06d3 100644 --- a/process/process_linux.go +++ b/process/process_linux.go @@ -120,6 +120,9 @@ func (p *Process) Parent() (*Process, error) { if err != nil { return nil, err } + if p.parent == 0 { + return nil, fmt.Errorf("wrong number of parents") + } return NewProcess(p.parent) } func (p *Process) Status() (string, error) {