]>
Commit | Line | Data |
---|---|---|
ce856250 WB |
1 | From 607a79df39bbe1e4b3e09dc54c0388ed6140cf7b Mon Sep 17 00:00:00 2001 |
2 | From: Wolfgang Bumiller <w.bumiller@proxmox.com> | |
3 | Date: Fri, 24 Apr 2020 09:17:06 +0200 | |
4 | Subject: [PATCH lxcfs] proc_fuse: silence error when we find no memlimit | |
5 | ||
6 | We get a positive result with an empty string if we do not | |
7 | encounter any limits while walking up the cgroup. | |
8 | ||
9 | Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com> | |
10 | --- | |
11 | src/proc_fuse.c | 2 +- | |
12 | 1 file changed, 1 insertion(+), 1 deletion(-) | |
13 | ||
14 | diff --git a/src/proc_fuse.c b/src/proc_fuse.c | |
15 | index b2edf76..ae06bff 100644 | |
16 | --- a/src/proc_fuse.c | |
17 | +++ b/src/proc_fuse.c | |
18 | @@ -210,7 +210,7 @@ static uint64_t get_memlimit(const char *cgroup, bool swap) | |
19 | ret = cgroup_ops->get_memory_swap_max(cgroup_ops, cgroup, &memlimit_str); | |
20 | else | |
21 | ret = cgroup_ops->get_memory_max(cgroup_ops, cgroup, &memlimit_str); | |
22 | - if (ret > 0 && safe_uint64(memlimit_str, &memlimit, 10) < 0) | |
23 | + if (ret > 0 && memlimit_str[0] && safe_uint64(memlimit_str, &memlimit, 10) < 0) | |
24 | lxcfs_error("Failed to convert memlimit %s", memlimit_str); | |
25 | ||
26 | return memlimit; | |
27 | -- | |
28 | 2.20.1 | |
29 |