diff --git a/src/os/serenity.cpp b/src/os/serenity.cpp index 662258b..0fb8a19 100644 --- a/src/os/serenity.cpp +++ b/src/os/serenity.cpp @@ -1,23 +1,20 @@ #ifdef __serenity__ // clang-format off -#include // For errno -#include // For strerror -#include -#include -#include +#include // std::format +#include // std::ifstream #include // glz::object #include // glz::error_ctx, glz::error_code #include // glz::detail::Object -#include // glz::read_json -#include -#include // For getpwuid(), struct passwd -#include -#include -#include -#include // For uid_t -#include -#include +#include // glz::read +#include // std::istreambuf_iterator +#include // getpwuid, struct passwd +#include // std::string (String) +#include // std::string_view (StringView) +#include // statvfs +#include // uid_t +#include // utsname, uname +#include // getuid, gethostname #include "src/util/defs.hpp" #include "src/util/error.hpp" @@ -99,9 +96,8 @@ namespace os { fn GetDesktopEnvironment() -> Result { return "SerenityOS Desktop"; } fn GetShell() -> Result { - uid_t userId = getuid(); - errno = 0; - struct passwd* pw = getpwuid(userId); + uid_t userId = getuid(); + struct passwd* pw = getpwuid(userId); if (pw == nullptr) return Err(DracError(DracErrorCode::NotFound, std::format("User ID {} not found in /etc/passwd", userId)));