creport: update for 10.0.0

This commit is contained in:
Michael Scire 2020-04-14 04:48:57 -07:00
parent 36039ddbb7
commit 11f840b1e3
2 changed files with 9 additions and 1 deletions

View file

@ -23,6 +23,7 @@
"erpt:c",
"fatal:u",
"ns:dev",
"pgl",
"time:*",
"fsp-srv"
],

View file

@ -108,7 +108,14 @@ int main(int argc, char **argv) {
g_crash_report.SaveReport();
/* Try to terminate the process. */
{
if (hos::GetVersion() >= hos::Version_10_0_0) {
/* On 10.0.0+, use pgl to terminate. */
sm::ScopedServiceHolder<pglInitialize, pglExit> pgl_holder;
if (pgl_holder) {
pglTerminateProcess(static_cast<u64>(crashed_pid));
}
} else {
/* On < 10.0.0, use ns:dev to terminate. */
sm::ScopedServiceHolder<nsdevInitialize, nsdevExit> ns_holder;
if (ns_holder) {
nsdevTerminateProcess(static_cast<u64>(crashed_pid));