mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
Processing (Haiku): support exe path detection
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
#include <sys/sysctl.h>
|
||||
#elif defined(__HAIKU__)
|
||||
#include <OS.h>
|
||||
#include <image.h>
|
||||
#endif
|
||||
|
||||
enum { FF_PIPE_BUFSIZ = 8192 };
|
||||
@@ -312,6 +313,21 @@ void ffProcessGetInfoLinux(pid_t pid, FFstrbuf* processName, FFstrbuf* exe, cons
|
||||
}
|
||||
kvm_close(kd);
|
||||
|
||||
#elif defined(__HAIKU__)
|
||||
|
||||
if (exePath)
|
||||
{
|
||||
image_info info;
|
||||
int32 cookie = 0;
|
||||
|
||||
while (get_next_image_info(pid, &cookie, &info) == B_OK)
|
||||
{
|
||||
if (info.type != B_APP_IMAGE) continue;
|
||||
ffStrbufSetS(exePath, info.name);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
if(exe->length == 0)
|
||||
@@ -488,6 +504,8 @@ const char* ffProcessGetBasicInfoLinux(pid_t pid, FFstrbuf* name, pid_t* ppid, i
|
||||
*ppid = info.parent;
|
||||
}
|
||||
|
||||
FF_UNUSED(tty);
|
||||
|
||||
#else
|
||||
|
||||
return "Unsupported platform";
|
||||
|
||||
Reference in New Issue
Block a user