From 0b6f40d4a4836872e654e38eb13afd1b55ccabb1 Mon Sep 17 00:00:00 2001 From: Dean Lee Date: Tue, 4 Oct 2022 01:16:38 +0800 Subject: [PATCH] proclogd: fix wrong type for rss (#25923) rss is long old-commit-hash: 379b7cf8b6573a448ebd1eba4b64c2b588a74d81 --- system/proclogd/proclog.cc | 2 +- system/proclogd/proclog.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/system/proclogd/proclog.cc b/system/proclogd/proclog.cc index cbe3b53493..09ab4f559e 100644 --- a/system/proclogd/proclog.cc +++ b/system/proclogd/proclog.cc @@ -95,7 +95,7 @@ std::optional procStat(std::string stat) { .num_threads = stol(v[StatPos::num_threads - 1]), .starttime = stoull(v[StatPos::starttime - 1]), .vms = stoul(v[StatPos::vsize - 1]), - .rss = stoul(v[StatPos::rss - 1]), + .rss = stol(v[StatPos::rss - 1]), .processor = stoi(v[StatPos::processor - 1]), }; return p; diff --git a/system/proclogd/proclog.h b/system/proclogd/proclog.h index 9ed53d1bac..49f97cdd36 100644 --- a/system/proclogd/proclog.h +++ b/system/proclogd/proclog.h @@ -20,8 +20,8 @@ struct ProcCache { struct ProcStat { int pid, ppid, processor; char state; - long cutime, cstime, priority, nice, num_threads; - unsigned long utime, stime, vms, rss; + long cutime, cstime, priority, nice, num_threads, rss; + unsigned long utime, stime, vms; unsigned long long starttime; std::string name; };