Permalink
Browse files

internal/sysutil: Fix build error on FreeBSD due to Rlimit.Cur type m…

…ismatch. (#752)

Document why type conversion is necessary. Otherwise, it's not clear
that it's neccessary, and we we wouldn't be able to catch breakage if
it were removed.
  • Loading branch information...
juergenhoetzel authored and dmitshur committed Feb 14, 2018
1 parent 296de81 commit 3926a9f66452f7a8c8d9c0e4e3074383f9aff5cd
Showing with 1 addition and 1 deletion.
  1. +1 −1 internal/sysutil/sysutil.go
@@ -9,5 +9,5 @@ import "golang.org/x/sys/unix"
func RlimitStack() (cur uint64, err error) {
var r unix.Rlimit
err = unix.Getrlimit(unix.RLIMIT_STACK, &r)
return r.Cur, err
return uint64(r.Cur), err // Type conversion because Cur is one of uint64, int64 depending on unix flavor.
}

0 comments on commit 3926a9f

Please sign in to comment.