mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 20:42:44 +02:00
sm: add retry loop in smInitialize (#270)
This commit is contained in:
parent
0666e4651e
commit
d6ba6d9625
@ -56,8 +56,12 @@ Result smInitialize(void)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
Result rc = svcConnectToNamedPort(&g_smHandle, "sm:");
|
Result rc = svcConnectToNamedPort(&g_smHandle, "sm:");
|
||||||
Handle tmp;
|
while (R_VALUE(rc) == KERNELRESULT(NotFound)) {
|
||||||
|
svcSleepThread(50000000ul);
|
||||||
|
rc = svcConnectToNamedPort(&g_smHandle, "sm:");
|
||||||
|
}
|
||||||
|
|
||||||
|
Handle tmp;
|
||||||
if (R_SUCCEEDED(rc) && smGetServiceOriginal(&tmp, smEncodeName("")) == 0x415) {
|
if (R_SUCCEEDED(rc) && smGetServiceOriginal(&tmp, smEncodeName("")) == 0x415) {
|
||||||
IpcCommand c;
|
IpcCommand c;
|
||||||
ipcInitialize(&c);
|
ipcInitialize(&c);
|
||||||
|
Loading…
Reference in New Issue
Block a user