mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-04 05:20:30 +00:00
HackStudio: Use Core::System::exec()
This commit is contained in:
parent
88800e8f32
commit
eb857e45dc
Notes:
sideshowbarker
2024-07-17 12:05:40 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/eb857e45dc Pull-request: https://github.com/SerenityOS/serenity/pull/13013 Reviewed-by: https://github.com/ADKaster Reviewed-by: https://github.com/bgianfo
1 changed files with 3 additions and 12 deletions
|
@ -60,18 +60,9 @@ ErrorOr<void> TerminalWrapper::run_command(String const& command, Optional<Strin
|
|||
|
||||
TRY(setup_slave_pseudoterminal(ptm_fd));
|
||||
|
||||
auto parts = command.split(' ');
|
||||
VERIFY(!parts.is_empty());
|
||||
char const** args = (char const**)calloc(parts.size() + 1, sizeof(char const*));
|
||||
for (size_t i = 0; i < parts.size(); i++) {
|
||||
args[i] = parts[i].characters();
|
||||
}
|
||||
|
||||
auto rc = execvp(args[0], const_cast<char**>(args));
|
||||
if (rc < 0) {
|
||||
perror("execve");
|
||||
exit(1);
|
||||
}
|
||||
auto args = command.split_view(' ');
|
||||
VERIFY(!args.is_empty());
|
||||
TRY(Core::System::exec(args[0], args, Core::System::SearchInPath::Yes));
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue