mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-02-23 07:31:56 +00:00
Implement auto restart for Linux too.
This commit is contained in:
parent
048ccc9b79
commit
5331c5bf84
@ -192,6 +192,7 @@ bool System_MakeRequest(SystemRequestType type, int requestId, const std::string
|
||||
switch (type) {
|
||||
case SystemRequestType::RESTART_APP:
|
||||
g_RestartRequested = true;
|
||||
// TODO: Also save param1 and then split it into an argv.
|
||||
return true;
|
||||
case SystemRequestType::EXIT_APP:
|
||||
// Do a clean exit
|
||||
@ -1400,6 +1401,10 @@ int main(int argc, char *argv[]) {
|
||||
if (g_RestartRequested) {
|
||||
#if PPSSPP_PLATFORM(MAC)
|
||||
RestartMacApp();
|
||||
#elif PPSSPP_PLATFORM(LINUX)
|
||||
// Hackery from https://unix.stackexchange.com/questions/207935/how-to-restart-or-reset-a-running-process-in-linux,
|
||||
char *exec_argv[] = { argv[0], nullptr };
|
||||
execv("/proc/self/exe", exec_argv);
|
||||
#endif
|
||||
}
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user