declarations to assignments

This commit is contained in:
Nicholas Orlowsky 2023-03-31 00:53:34 -05:00
parent 3ae35a045d
commit 7f6472617b
No known key found for this signature in database
GPG key ID: 58832FD3AC16C706

View file

@ -48,10 +48,10 @@ func NumCPU() int {
cpuPeriod := -1
if cgroupVersion == 1 {
cpuQuota := readCgroupFileToInt64(cgroupPath, "cpu.cfs_quota_us")
cpuPeriod := readCgroupFileToInt64(cgroupPath, "cpu.cfs_period_us")
cpuQuota = readCgroupFileToInt64(cgroupPath, "cpu.cfs_quota_us")
cpuPeriod = readCgroupFileToInt64(cgroupPath, "cpu.cfs_period_us")
} else if cgroupVersion == 2 {
cpuQuota, cpuPeriod := readCgroup2FileToInt64Tuple(cgroupPath, "cpu.max")
cpuQuota, cpuPeriod = readCgroup2FileToInt64Tuple(cgroupPath, "cpu.max")
}
if cpuQuota == -1 || cpuPeriod == -1 {