mirror of
https://github.com/RGBCube/serenity
synced 2025-05-17 22:05:08 +00:00
LibCore: Tweak slightly-off error message in CProcessStatisticsReader.
This commit is contained in:
parent
245ae479eb
commit
c33766f039
1 changed files with 3 additions and 3 deletions
|
@ -10,14 +10,14 @@ HashMap<uid_t, String> CProcessStatisticsReader::s_usernames;
|
||||||
|
|
||||||
HashMap<pid_t, CProcessStatistics> CProcessStatisticsReader::get_all()
|
HashMap<pid_t, CProcessStatistics> CProcessStatisticsReader::get_all()
|
||||||
{
|
{
|
||||||
HashMap<pid_t, CProcessStatistics> map;
|
|
||||||
|
|
||||||
CFile file("/proc/all");
|
CFile file("/proc/all");
|
||||||
if (!file.open(CIODevice::ReadOnly)) {
|
if (!file.open(CIODevice::ReadOnly)) {
|
||||||
fprintf(stderr, "CProcessHelper : failed to open /proc/all: %s\n", file.error_string());
|
fprintf(stderr, "CProcessStatisticsReader: Failed to open /proc/all: %s\n", file.error_string());
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HashMap<pid_t, CProcessStatistics> map;
|
||||||
|
|
||||||
auto file_contents = file.read_all();
|
auto file_contents = file.read_all();
|
||||||
auto json = JsonValue::from_string({ file_contents.data(), file_contents.size() });
|
auto json = JsonValue::from_string({ file_contents.data(), file_contents.size() });
|
||||||
json.as_array().for_each([&](auto& value) {
|
json.as_array().for_each([&](auto& value) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue