From 39024abae958ff0cef8a5bd7ab83740ba3e61148 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Sun, 30 Aug 2026 19:41:18 +0800 Subject: [PATCH] Processes (Haiku): honors `options->countKprocs` --- src/detection/processes/processes_haiku.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/detection/processes/processes_haiku.c b/src/detection/processes/processes_haiku.c index 484a32119..feecc34e5 100644 --- a/src/detection/processes/processes_haiku.c +++ b/src/detection/processes/processes_haiku.c @@ -2,7 +2,7 @@ #include -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; }