aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-04-09 06:41:03 -0400
committerGitHub <noreply@github.com>2021-04-09 06:41:03 -0400
commit54dce001cce131bbbdcf16512a4722e080561fc7 (patch)
tree1ce3c8399cc34dcf4c83955bd3f27ea997baed27
parent4efac1f76012c35122bca7c8feebc33141fc47d3 (diff)
parentce747466a9ec44b97dac96ab39c31e06ae761fde (diff)
downloadpodman-54dce001cce131bbbdcf16512a4722e080561fc7.tar.gz
podman-54dce001cce131bbbdcf16512a4722e080561fc7.tar.bz2
podman-54dce001cce131bbbdcf16512a4722e080561fc7.zip
Merge pull request #9982 from giuseppe/read-cgroups-stats-uint64
cgroups: force 64 bits to ParseUint
-rw-r--r--pkg/cgroups/cgroups.go2
-rw-r--r--pkg/cgroups/cpu.go8
2 files changed, 5 insertions, 5 deletions
diff --git a/pkg/cgroups/cgroups.go b/pkg/cgroups/cgroups.go
index 608e1647a..aefb5183b 100644
--- a/pkg/cgroups/cgroups.go
+++ b/pkg/cgroups/cgroups.go
@@ -265,7 +265,7 @@ func readFileAsUint64(path string) (uint64, error) {
if v == "max" {
return math.MaxUint64, nil
}
- ret, err := strconv.ParseUint(v, 10, 0)
+ ret, err := strconv.ParseUint(v, 10, 64)
if err != nil {
return ret, errors.Wrapf(err, "parse %s from %s", v, path)
}
diff --git a/pkg/cgroups/cpu.go b/pkg/cgroups/cpu.go
index 05223c2e1..23539757d 100644
--- a/pkg/cgroups/cpu.go
+++ b/pkg/cgroups/cpu.go
@@ -40,7 +40,7 @@ func readAcctList(ctr *CgroupControl, name string) ([]uint64, error) {
if s == "" {
break
}
- v, err := strconv.ParseUint(s, 10, 0)
+ v, err := strconv.ParseUint(s, 10, 64)
if err != nil {
return nil, errors.Wrapf(err, "parsing %s", s)
}
@@ -80,14 +80,14 @@ func (c *cpuHandler) Stat(ctr *CgroupControl, m *Metrics) error {
return err
}
if val, found := values["usage_usec"]; found {
- usage.Total, err = strconv.ParseUint(cleanString(val[0]), 10, 0)
+ usage.Total, err = strconv.ParseUint(cleanString(val[0]), 10, 64)
if err != nil {
return err
}
usage.Kernel *= 1000
}
if val, found := values["system_usec"]; found {
- usage.Kernel, err = strconv.ParseUint(cleanString(val[0]), 10, 0)
+ usage.Kernel, err = strconv.ParseUint(cleanString(val[0]), 10, 64)
if err != nil {
return err
}
@@ -149,7 +149,7 @@ func GetSystemCPUUsage() (uint64, error) {
}
if val, found := values["usage_usec"]; found {
- v, err := strconv.ParseUint(cleanString(val[0]), 10, 0)
+ v, err := strconv.ParseUint(cleanString(val[0]), 10, 64)
if err != nil {
return 0, err
}