|
|
@ -351,11 +351,11 @@ func (p *Process) PageFaultsWithContext(ctx context.Context) (*PageFaultsStat, e
|
|
|
|
func (p *Process) ChildrenWithContext(ctx context.Context) ([]*Process, error) {
|
|
|
|
func (p *Process) ChildrenWithContext(ctx context.Context) ([]*Process, error) {
|
|
|
|
pids, err := common.CallPgrepWithContext(ctx, invoke, p.Pid)
|
|
|
|
pids, err := common.CallPgrepWithContext(ctx, invoke, p.Pid)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
return nil, err
|
|
|
|
|
|
|
|
}
|
|
|
|
if len(pids) == 0 {
|
|
|
|
if len(pids) == 0 {
|
|
|
|
return nil, ErrorNoChildren
|
|
|
|
return nil, ErrorNoChildren
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nil, err
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
ret := make([]*Process, 0, len(pids))
|
|
|
|
ret := make([]*Process, 0, len(pids))
|
|
|
|
for _, pid := range pids {
|
|
|
|
for _, pid := range pids {
|
|
|
|
np, err := NewProcessWithContext(ctx, pid)
|
|
|
|
np, err := NewProcessWithContext(ctx, pid)
|
|
|
|