Ver código fonte

LibCore: Remove Process::spawn(StringView, ReadonlySpan<char const*>)

stasoid 8 meses atrás
pai
commit
61d52c8a3f
2 arquivos alterados com 0 adições e 23 exclusões
  1. 0 20
      Libraries/LibCore/Process.cpp
  2. 0 3
      Libraries/LibCore/Process.h

+ 0 - 20
Libraries/LibCore/Process.cpp

@@ -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)

+ 0 - 3
Libraries/LibCore/Process.h

@@ -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,