1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 09:04:59 +00:00

Utilities: Use Core::Environment instead of Core::System::*env()

This commit is contained in:
Sam Atkins 2024-02-07 16:06:58 +00:00 committed by Sam Atkins
parent b9dc2d7ebf
commit 7109f3706e
4 changed files with 11 additions and 8 deletions

View file

@ -8,6 +8,7 @@
#include <AK/ByteString.h>
#include <AK/Format.h>
#include <LibCore/ArgsParser.h>
#include <LibCore/Environment.h>
#include <LibCore/System.h>
#include <LibGUI/Application.h>
#include <LibGUI/Clipboard.h>
@ -27,7 +28,7 @@ static void spawn_command(Span<StringView> command, ByteBuffer const& data, char
MUST(Core::System::dup2(pipefd[0], 0));
MUST(Core::System::close(pipefd[0]));
MUST(Core::System::close(pipefd[1]));
MUST(Core::System::setenv("CLIPBOARD_STATE"sv, { state, strlen(state) }, true));
MUST(Core::Environment::set("CLIPBOARD_STATE"sv, { state, strlen(state) }, Core::Environment::Overwrite::Yes));
MUST(Core::System::exec(command[0], command, Core::System::SearchInPath::Yes));
perror("exec");
exit(1);