1
0
mirror of https://github.com/shirou/gopsutil.git synced 2025-04-26 13:48:59 +08:00

process: unbreak build on OpenBSD

Match FreeBSD code to prevent:
process_openbsd.go:230:10: cannot use k.Groups (type [16]uint32) as type []int32 in return argument
This commit is contained in:
Antoine Jacoutot 2020-10-24 15:35:19 +02:00
parent cf222ab258
commit 013cd610f5

View File

@ -176,7 +176,12 @@ func (p *Process) GroupsWithContext(ctx context.Context) ([]int32, error) {
return nil, err
}
return k.Groups, nil
groups := make([]int32, k.Ngroups)
for i := int16(0); i < k.Ngroups; i++ {
groups[i] = int32(k.Groups[i])
}
return groups, nil
}
func (p *Process) TerminalWithContext(ctx context.Context) (string, error) {