mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-04 05:20:30 +00:00
profile: Use Core::System::exec()
This commit is contained in:
parent
eb857e45dc
commit
b81a3a6f0e
Notes:
sideshowbarker
2024-07-17 12:05:35 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/b81a3a6f0e 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 11 deletions
|
@ -107,20 +107,11 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
return 0;
|
||||
}
|
||||
|
||||
auto cmd_parts = String(cmd_argument).split(' ');
|
||||
Vector<char const*> cmd_argv;
|
||||
|
||||
for (auto& part : cmd_parts)
|
||||
cmd_argv.append(part.characters());
|
||||
|
||||
cmd_argv.append(nullptr);
|
||||
auto cmd_parts = String(cmd_argument).split_view(' ');
|
||||
|
||||
dbgln("Enabling profiling for PID {}", getpid());
|
||||
TRY(Core::System::profiling_enable(getpid(), event_mask));
|
||||
if (execvp(cmd_argv[0], const_cast<char**>(cmd_argv.data())) < 0) {
|
||||
perror("execv");
|
||||
return 1;
|
||||
}
|
||||
TRY(Core::System::exec(cmd_parts[0], cmd_parts, Core::System::SearchInPath::Yes));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue