]> git.proxmox.com Git - mirror_lxcfs.git/commitdiff
proc_fuse: silence error when we find no memlimit
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Fri, 24 Apr 2020 07:17:06 +0000 (09:17 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Fri, 24 Apr 2020 07:17:06 +0000 (09:17 +0200)
We get a positive result with an empty string if we do not
encounter any limits while walking up the cgroup.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
src/proc_fuse.c

index b2edf76739e70f546ed856317ee66110278cf85e..ae06bff2c543c53b1e8d2024b25cf7660673ee48 100644 (file)
@@ -210,7 +210,7 @@ static uint64_t get_memlimit(const char *cgroup, bool swap)
                ret = cgroup_ops->get_memory_swap_max(cgroup_ops, cgroup, &memlimit_str);
        else
                ret = cgroup_ops->get_memory_max(cgroup_ops, cgroup, &memlimit_str);
-       if (ret > 0 && safe_uint64(memlimit_str, &memlimit, 10) < 0)
+       if (ret > 0 && memlimit_str[0] && safe_uint64(memlimit_str, &memlimit, 10) < 0)
                lxcfs_error("Failed to convert memlimit %s", memlimit_str);
 
        return memlimit;