mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:17:35 +00:00
LibCore: Return ErrorOr<pid_t> and support arguments in Process::spawn
This makes the wrapper more like the rest in LibCore, and also removes the annoying limitation of not supporting arguments. There are three overloads one for String, char const *, and StringView argument lists. As long as there are <= 10 arguments the argv list will be allocated inline, otherwise on the heap.
This commit is contained in:
parent
0295d79339
commit
3fc0350caf
11 changed files with 77 additions and 28 deletions
|
@ -48,9 +48,7 @@ ErrorOr<void> QuickLaunchEntryAppFile::launch() const
|
|||
|
||||
ErrorOr<void> QuickLaunchEntryExecutable::launch() const
|
||||
{
|
||||
auto pid = Core::Process::spawn(m_path);
|
||||
if (pid < 0)
|
||||
return Error::from_syscall("Core::Process::spawn", -errno);
|
||||
TRY(Core::Process::spawn(m_path));
|
||||
return {};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue