]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
common/util: use ifstream to read from /proc files 32630/head
authorKefu Chai <kchai@redhat.com>
Tue, 14 Jan 2020 08:47:41 +0000 (16:47 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 14 Jan 2020 08:51:38 +0000 (16:51 +0800)
commitecddb1dd24756b0049cf9d32fe49ae5d13f96b44
tree67fad6c18cdaabbd3a821d95898dc682ff3c6bfe
parentb127d6d32e5f4dc5ed9104359e8ecb74046e4723
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>
src/common/util.cc