]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
common/util: use ifstream to read from /proc files 32901/head
authorKefu Chai <kchai@redhat.com>
Tue, 14 Jan 2020 08:47:41 +0000 (16:47 +0800)
committerNathan Cutler <ncutler@suse.com>
Mon, 27 Jan 2020 14:37:29 +0000 (15:37 +0100)
commitd8ff6bc96339d81079b41b7cda026e3b0921707f
tree8c71458793485a60e89c0fe17f42fe31db036553
parent548e59e7fca2cbee137ef1c5b7b514b50172db10
common/util: use ifstream to read from /proc files

refactor `collect_sys_info()` to use ifstream, getline and boost string
helpers to read and parse the /proc/meminfo and /proc/cpuinfo. for
better readability, and it's less error-prone.

Related-To: https://tracker.ceph.com/issues/43306
Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit ecddb1dd24756b0049cf9d32fe49ae5d13f96b44)
src/common/util.cc