From 964335f9e3e42e1e2cc25af09dd0b7f254597337 Mon Sep 17 00:00:00 2001 From: Mars Date: Sat, 3 May 2025 02:28:13 -0400 Subject: [PATCH] i dont feel like figuring this out rn --- src/os/bsd.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/os/bsd.cpp b/src/os/bsd.cpp index c34c154..9403abb 100644 --- a/src/os/bsd.cpp +++ b/src/os/bsd.cpp @@ -135,6 +135,9 @@ namespace { } fn GetWaylandCompositor() -> Result { + #ifndef __FreeBSD__ + return "Wayland Compositor"; + #else const wl::DisplayGuard display; if (!display) @@ -146,7 +149,6 @@ namespace { pid_t peerPid = -1; // Initialize PID - #if defined(__FreeBSD__) || defined(__DragonFly__) struct xucred cred; socklen_t len = sizeof(cred); @@ -155,15 +157,6 @@ namespace { return Err(DracError::withErrno("Failed to get socket credentials (LOCAL_PEERCRED)")); peerPid = cred.cr_pid; - #elif defined(__NetBSD__) - uid_t euid; - gid_t egid; - - if (getpeereid(fileDescriptor, &euid, &egid) == -1) - return Err(DracError::withErrno("getpeereid failed on Wayland socket")); - - return "Wayland Compositor (Unknown Path)"; - #endif if (peerPid <= 0) return Err(DracError(DracErrorCode::PlatformSpecific, "Failed to obtain a valid peer PID")); @@ -198,6 +191,7 @@ namespace { } return String(compositorNameView); + #endif } } // namespace @@ -452,7 +446,7 @@ namespace os { else buffer.at(0) = '\0'; - #elif defined(__NetBSD__) + #elifdef __NetBSD__ if (sysctlbyname("machdep.dmi.system-product", buffer.data(), &size, nullptr, 0) == -1) return Err(DracError::withErrno(std::format("sysctlbyname failed for")));