diff --git a/src/common/processing_linux.c b/src/common/processing_linux.c index 26112248b..032e774c1 100644 --- a/src/common/processing_linux.c +++ b/src/common/processing_linux.c @@ -315,39 +315,17 @@ void ffProcessGetInfoLinux(pid_t pid, FFstrbuf* processName, FFstrbuf* exe, cons #elif defined(__HAIKU__) - { - team_info info; - if (get_team_info(pid, &info) == B_OK) - { - // This is tricky. Paths in info.args are not quoted, so that we don't know - // if a whitespace in args is part of the file path or an argument separator - if (info.argc == 1) - ffStrbufSetS(exe, info.args); - else - { - // args = "/bin/bash -l" - // argc = 2 - int argc = info.argc - 1; - const char* arg0End = strchr(info.args, ' '); - for (const char* p = arg0End + 1; (p = strchr(p, ' ')); ++p) - --argc; - if (argc == 1) // No whitespace in the file path - ffStrbufSetNS(exe, (uint32_t) (arg0End - info.args), info.args); - } - } - } + image_info info; + int32 cookie = 0; - if (exePath) + while (get_next_image_info(pid, &cookie, &info) == B_OK) { - image_info info; - int32 cookie = 0; + if (info.type != B_APP_IMAGE) continue; + ffStrbufSetS(exe, info.name); - while (get_next_image_info(pid, &cookie, &info) == B_OK) - { - if (info.type != B_APP_IMAGE) continue; - ffStrbufSetS(exePath, info.name); - break; - } + if (exePath) + ffStrbufSet(exePath, exe); + break; } #endif