Skip to content

Commit

Permalink
Merge pull request #1231 from shirou/feature/process_linux_Children_f…
Browse files Browse the repository at this point in the history
…ix_error_check

[process][linux] Fix error handling on Children.
  • Loading branch information
shirou authored Jan 23, 2022
2 parents 72100d4 + 35fbe38 commit 5ba00db
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions process/process_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -351,11 +351,11 @@ func (p *Process) PageFaultsWithContext(ctx context.Context) (*PageFaultsStat, e
func (p *Process) ChildrenWithContext(ctx context.Context) ([]*Process, error) {
pids, err := common.CallPgrepWithContext(ctx, invoke, p.Pid)
if err != nil {
if len(pids) == 0 {
return nil, ErrorNoChildren
}
return nil, err
}
if len(pids) == 0 {
return nil, ErrorNoChildren
}
ret := make([]*Process, 0, len(pids))
for _, pid := range pids {
np, err := NewProcessWithContext(ctx, pid)
Expand Down

0 comments on commit 5ba00db

Please sign in to comment.