mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 06:14:58 +00:00
SystemServer: Use Core::Environment instead of Core::System::*env()
This commit is contained in:
parent
dd92c33498
commit
f4e6f5c1cc
1 changed files with 4 additions and 3 deletions
|
@ -13,6 +13,7 @@
|
|||
#include <AK/StringBuilder.h>
|
||||
#include <LibCore/ConfigFile.h>
|
||||
#include <LibCore/Directory.h>
|
||||
#include <LibCore/Environment.h>
|
||||
#include <LibCore/SessionManagement.h>
|
||||
#include <LibCore/SocketAddress.h>
|
||||
#include <LibCore/System.h>
|
||||
|
@ -137,7 +138,7 @@ ErrorOr<void> Service::change_privileges()
|
|||
dbgln("Failed to drop privileges (tried to change to GID={}, UID={}), due to {}\n", account.gid(), account.uid(), error_or_void.error());
|
||||
exit(1);
|
||||
}
|
||||
TRY(Core::System::setenv("HOME"sv, account.home_directory(), true));
|
||||
TRY(Core::Environment::set("HOME"sv, account.home_directory(), Core::Environment::Overwrite::Yes));
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
@ -216,13 +217,13 @@ ErrorOr<void> Service::spawn(int socket_fd)
|
|||
|
||||
if (!m_sockets.is_empty()) {
|
||||
// The new descriptor is !CLOEXEC here.
|
||||
TRY(Core::System::setenv("SOCKET_TAKEOVER"sv, socket_takeover_builder.string_view(), true));
|
||||
TRY(Core::Environment::set("SOCKET_TAKEOVER"sv, socket_takeover_builder.string_view(), Core::Environment::Overwrite::Yes));
|
||||
}
|
||||
|
||||
TRY(change_privileges());
|
||||
|
||||
TRY(m_environment.view().for_each_split_view(' ', SplitBehavior::Nothing, [&](auto env) {
|
||||
return Core::System::putenv(env);
|
||||
return Core::Environment::put(env);
|
||||
}));
|
||||
|
||||
Vector<StringView, 10> arguments;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue