mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-04 05:20:30 +00:00
strace: Use Core::System::exec()
This commit is contained in:
parent
3e5b1b1dbc
commit
1ac6c4df72
Notes:
sideshowbarker
2024-07-17 12:05:26 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/1ac6c4df72 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 2 additions and 8 deletions
|
@ -809,7 +809,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
{
|
||||
TRY(Core::System::pledge("stdio wpath cpath proc exec ptrace sigaction"));
|
||||
|
||||
Vector<char const*> child_argv;
|
||||
Vector<StringView> child_argv;
|
||||
|
||||
char const* output_filename = nullptr;
|
||||
char const* exclude_syscalls_option = nullptr;
|
||||
|
@ -849,17 +849,11 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
if (child_argv.is_empty())
|
||||
return Error::from_string_literal("Expected either a pid or some arguments"sv);
|
||||
|
||||
child_argv.append(nullptr);
|
||||
auto pid = TRY(Core::System::fork());
|
||||
|
||||
if (!pid) {
|
||||
TRY(Core::System::ptrace(PT_TRACE_ME, 0, 0, 0));
|
||||
|
||||
int rc = execvp(child_argv.first(), const_cast<char**>(child_argv.data()));
|
||||
if (rc < 0) {
|
||||
perror("execvp");
|
||||
exit(1);
|
||||
}
|
||||
TRY(Core::System::exec(child_argv.first(), child_argv, Core::System::SearchInPath::Yes));
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue