mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-21 03:55:32 +00:00
Terminate headless rpcs3 if nothing was booted
This commit is contained in:
parent
4f4a80cc04
commit
7895d43a98
1 changed files with 18 additions and 0 deletions
|
@ -999,6 +999,24 @@ int main(int argc, char** argv)
|
|||
}
|
||||
});
|
||||
}
|
||||
else if (s_headless || s_no_gui)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
// If launched from CMD
|
||||
if (AttachConsole(ATTACH_PARENT_PROCESS))
|
||||
[[maybe_unused]] const auto con_out = freopen("CONOUT$", "w", stderr);
|
||||
#endif
|
||||
sys_log.error("Cannot run %s mode without boot target. Terminating...", s_headless ? "headless" : "no-gui");
|
||||
fprintf(stderr, "Cannot run %s mode without boot target. Terminating...\n", s_headless ? "headless" : "no-gui");
|
||||
|
||||
if (s_no_gui)
|
||||
{
|
||||
QMessageBox::warning(nullptr, QObject::tr("Missing command-line arguments!"), QObject::tr("Cannot run no-gui mode without boot target.\nTerminating..."));
|
||||
}
|
||||
|
||||
Emu.Quit(true);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// run event loop (maybe only needed for the gui application)
|
||||
return app->exec();
|
||||
|
|
Loading…
Add table
Reference in a new issue