瀏覽代碼

common/fdlimit: Fix compilation error in freebsd, Raise() returns uint64 (#19141)

cast limit.Cur (int64) to uint64, fix test and compilation error
Enrique Fynn 6 年之前
父節點
當前提交
628a0bde3f
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      common/fdlimit/fdlimit_freebsd.go

+ 1 - 1
common/fdlimit/fdlimit_freebsd.go

@@ -43,7 +43,7 @@ func Raise(max uint64) (uint64, error) {
 	if err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, &limit); err != nil {
 		return 0, err
 	}
-	return limit.Cur, nil
+	return uint64(limit.Cur), nil
 }
 
 // Current retrieves the number of file descriptors allowed to be opened by this