1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 09:38:11 +00:00

LibCore: Use Core::Environment::raw_environ() instead of environment()

This commit is contained in:
Sam Atkins 2024-01-30 18:30:22 +00:00 committed by Sam Atkins
parent 40b04d4da5
commit c2bc07ef7c
4 changed files with 8 additions and 18 deletions

View file

@ -9,6 +9,7 @@
#include "Command.h"
#include <AK/Format.h>
#include <AK/ScopeGuard.h>
#include <LibCore/Environment.h>
#include <LibCore/File.h>
#include <LibCore/System.h>
#include <fcntl.h>
@ -30,7 +31,7 @@ ErrorOr<OwnPtr<Command>> Command::create(StringView command, char const* const a
posix_spawn_file_actions_adddup2(&file_actions, stdout_fds[1], STDOUT_FILENO);
posix_spawn_file_actions_adddup2(&file_actions, stderr_fds[1], STDERR_FILENO);
auto pid = TRY(Core::System::posix_spawnp(command, &file_actions, nullptr, const_cast<char**>(arguments), System::environment()));
auto pid = TRY(Core::System::posix_spawnp(command, &file_actions, nullptr, const_cast<char**>(arguments), Core::Environment::raw_environ()));
posix_spawn_file_actions_destroy(&file_actions);
ArmedScopeGuard runner_kill { [&pid] { kill(pid, SIGKILL); } };