mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-30 00:37:23 +01:00
Processes (Haiku): honors options->countKprocs
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
#include <OS.h>
|
||||
|
||||
const char* ffDetectProcesses(const FFProcessesOptions*, FFProcessesResult* result) {
|
||||
const char* ffDetectProcesses(const FFProcessesOptions* options, FFProcessesResult* result) {
|
||||
system_info info;
|
||||
if (get_system_info(&info) != B_OK) {
|
||||
return "Error getting system info";
|
||||
@@ -11,5 +11,13 @@ const char* ffDetectProcesses(const FFProcessesOptions*, FFProcessesResult* resu
|
||||
result->processes = info.used_teams;
|
||||
result->threads = info.used_threads;
|
||||
|
||||
if (!options->countKprocs) {
|
||||
team_info ti;
|
||||
if (get_team_info(B_SYSTEM_TEAM, &ti) == B_OK) {
|
||||
result->processes--;
|
||||
result->threads -= (uint32_t) ti.thread_count;
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user