mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 15:37:46 +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
|
@ -54,7 +54,7 @@ WelcomeWidget::WelcomeWidget()
|
|||
m_help_button = *find_descendant_of_type_named<GUI::Button>("help_button");
|
||||
m_help_button->set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/book-open.png").release_value_but_fixme_should_propagate_errors());
|
||||
m_help_button->on_click = [](auto) {
|
||||
Core::Process::spawn("/bin/Help"sv);
|
||||
MUST(Core::Process::spawn("/bin/Help"sv));
|
||||
};
|
||||
|
||||
m_new_button = *find_descendant_of_type_named<GUI::Button>("new_button");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue