diff options
| author | danlark <[email protected]> | 2022-02-10 16:46:10 +0300 |
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:46:10 +0300 |
| commit | baa58daefa91fde4b4769facdbd2903763b9c6a8 (patch) | |
| tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /library/cpp/actors/core/process_stats.cpp | |
| parent | 3426a9bc7f169ae9da54cef557ad2a33f6e8eee0 (diff) | |
Restoring authorship annotation for <[email protected]>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/actors/core/process_stats.cpp')
| -rw-r--r-- | library/cpp/actors/core/process_stats.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/library/cpp/actors/core/process_stats.cpp b/library/cpp/actors/core/process_stats.cpp index 3edbaded63e..0e1dbd00314 100644 --- a/library/cpp/actors/core/process_stats.cpp +++ b/library/cpp/actors/core/process_stats.cpp @@ -25,11 +25,11 @@ namespace NActors { static bool ExtractVal(const TString& str, const TString& name, TVal& res) { if (!str.StartsWith(name)) return false; - size_t pos = name.size(); - while (pos < str.size() && (str[pos] == ' ' || str[pos] == '\t')) { + size_t pos = name.size(); + while (pos < str.size() && (str[pos] == ' ' || str[pos] == '\t')) { pos++; } - res = atol(str.data() + pos); + res = atol(str.data() + pos); return true; } @@ -63,7 +63,7 @@ namespace NActors { TFileInput procStat("/proc/" + strPid + "/stat"); procStat.ReadLine(str); if (!str.empty()) { - sscanf(str.data(), + sscanf(str.data(), "%d %*s %c %d %d %d %d %d %u %lu %lu " "%lu %lu %lu %lu %ld %ld %ld %ld %ld " "%ld %llu %lu %ld %lu", @@ -81,7 +81,7 @@ namespace NActors { TFileInput statm("/proc/" + strPid + "/statm"); statm.ReadLine(str); TVector<TString> fields; - StringSplitter(str).Split(' ').SkipEmpty().Collect(&fields); + StringSplitter(str).Split(' ').SkipEmpty().Collect(&fields); if (fields.size() >= 7) { ui64 resident = FromString<ui64>(fields[1]); ui64 shared = FromString<ui64>(fields[2]); |
