From 013cd610f5084787a33363545979a4391b24819d Mon Sep 17 00:00:00 2001 From: Antoine Jacoutot Date: Sat, 24 Oct 2020 15:35:19 +0200 Subject: [PATCH] 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 --- process/process_openbsd.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/process/process_openbsd.go b/process/process_openbsd.go index ff43d367..0404b4ba 100644 --- a/process/process_openbsd.go +++ b/process/process_openbsd.go @@ -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) {