mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 15:10:19 +00:00
LibCore: Remove Process::spawn(StringView, ReadonlySpan<char const*>)
This commit is contained in:
parent
33e7d6121b
commit
61d52c8a3f
Notes:
github-actions[bot]
2024-11-19 22:28:48 +00:00
Author: https://github.com/stasoid Commit: https://github.com/LadybirdBrowser/ladybird/commit/61d52c8a3fa Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2377 Reviewed-by: https://github.com/ADKaster ✅
2 changed files with 0 additions and 23 deletions
|
@ -158,26 +158,6 @@ ErrorOr<pid_t> Process::spawn(StringView path, ReadonlySpan<StringView> argument
|
|||
return process.pid();
|
||||
}
|
||||
|
||||
ErrorOr<pid_t> Process::spawn(StringView path, ReadonlySpan<char const*> arguments, ByteString working_directory, KeepAsChild keep_as_child)
|
||||
{
|
||||
Vector<ByteString> backing_strings;
|
||||
backing_strings.ensure_capacity(arguments.size());
|
||||
for (auto const& argument : arguments)
|
||||
backing_strings.append(argument);
|
||||
|
||||
auto process = TRY(spawn({
|
||||
.executable = path,
|
||||
.arguments = backing_strings,
|
||||
.working_directory = working_directory.is_empty() ? Optional<ByteString> {} : Optional<ByteString> { working_directory },
|
||||
}));
|
||||
|
||||
if (keep_as_child == KeepAsChild::No)
|
||||
TRY(process.disown());
|
||||
else
|
||||
process.m_should_disown = false;
|
||||
return process.pid();
|
||||
}
|
||||
|
||||
ErrorOr<String> Process::get_name()
|
||||
{
|
||||
#if defined(AK_OS_SERENITY)
|
||||
|
|
|
@ -78,9 +78,6 @@ public:
|
|||
static ErrorOr<pid_t> spawn(StringView path, ReadonlySpan<ByteString> arguments, ByteString working_directory = {}, KeepAsChild keep_as_child = KeepAsChild::No);
|
||||
static ErrorOr<pid_t> spawn(StringView path, ReadonlySpan<StringView> arguments, ByteString working_directory = {}, KeepAsChild keep_as_child = KeepAsChild::No);
|
||||
|
||||
// FIXME: Remove this. char const* should not exist on this level of abstraction.
|
||||
static ErrorOr<pid_t> spawn(StringView path, ReadonlySpan<char const*> arguments = {}, ByteString working_directory = {}, KeepAsChild keep_as_child = KeepAsChild::No);
|
||||
|
||||
static ErrorOr<String> get_name();
|
||||
enum class SetThreadName {
|
||||
No,
|
||||
|
|
Loading…
Reference in a new issue