rosalina: prevent disconnect when shell is closed
Fuck ndm, fuck StreetPass
This commit is contained in:
@@ -17,6 +17,8 @@
|
||||
#define _REENT_ONLY
|
||||
#include <errno.h>
|
||||
|
||||
#define ROSALINA_PREVENT_DISCONNECT (*(volatile bool*)0x1FF81108)
|
||||
|
||||
#define SYNC_ERROR ENODEV
|
||||
extern bool miniSocEnabled;
|
||||
|
||||
|
||||
@@ -140,7 +140,7 @@ static void handleSleepNotification(u32 notificationId)
|
||||
switch (notificationId)
|
||||
{
|
||||
case PTMNOTIFID_SLEEP_REQUESTED:
|
||||
PTMSYSM_ReplyToSleepQuery(miniSocEnabled); // deny sleep request if we have network stuff running
|
||||
PTMSYSM_ReplyToSleepQuery(ROSALINA_PREVENT_DISCONNECT); // deny sleep request if we have network stuff running
|
||||
break;
|
||||
case PTMNOTIFID_GOING_TO_SLEEP:
|
||||
case PTMNOTIFID_SLEEP_ALLOWED:
|
||||
|
||||
@@ -91,6 +91,7 @@ Result miniSocInit(void)
|
||||
|
||||
svcKernelSetState(0x10000, 2);
|
||||
miniSocEnabled = true;
|
||||
ROSALINA_PREVENT_DISCONNECT = true;
|
||||
return 0;
|
||||
|
||||
cleanup:
|
||||
@@ -134,6 +135,7 @@ Result miniSocExitDirect(void)
|
||||
{
|
||||
svcKernelSetState(0x10000, 2);
|
||||
miniSocEnabled = false;
|
||||
ROSALINA_PREVENT_DISCONNECT = false;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user