[lxc-devel] [lxcfs/master] Fix https://github.com/lxc/lxcfs/issues/404

joemoore13 on Github lxc-bot at linuxcontainers.org
Wed May 6 20:23:57 UTC 2020


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 344 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20200506/cdd709a7/attachment.bin>
-------------- next part --------------
From e05b2fffd9b69c9273348333d71cc6d6aed199bd Mon Sep 17 00:00:00 2001
From: Joseph Moore <joemoore1123 at gmail.com>
Date: Wed, 6 May 2020 13:23:35 -0700
Subject: [PATCH] Fix https://github.com/lxc/lxcfs/issues/404

reset  read_pos=0 after building usage_str
---
 src/proc_cpuview.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/proc_cpuview.c b/src/proc_cpuview.c
index 5c21bc4..686072b 100644
--- a/src/proc_cpuview.c
+++ b/src/proc_cpuview.c
@@ -1061,6 +1061,7 @@ int read_cpuacct_usage_all(char *cg, char *cpuset,
 		}
 
 		usage_str = data;
+		read_pos = 0;
 
 		lxcfs_v("usage_str: %s\n", usage_str);
 	}


More information about the lxc-devel mailing list