diff --git a/stratosphere/fs_mitm/source/fsmitm_main.cpp b/stratosphere/fs_mitm/source/fsmitm_main.cpp index f2601b3a2..ef351c94d 100644 --- a/stratosphere/fs_mitm/source/fsmitm_main.cpp +++ b/stratosphere/fs_mitm/source/fsmitm_main.cpp @@ -117,7 +117,7 @@ int main(int argc, char **argv) } /* TODO: What's a good timeout value to use here? */ - auto server_manager = std::make_unique(1, U64_MAX, 0x20000); + auto server_manager = std::make_unique(5, U64_MAX, 0x20000); //auto server_manager = std::make_unique(U64_MAX); /* Create fsp-srv mitm. */ diff --git a/stratosphere/libstratosphere/include/stratosphere/isession.hpp b/stratosphere/libstratosphere/include/stratosphere/isession.hpp index 95156a2d0..12fc6650b 100644 --- a/stratosphere/libstratosphere/include/stratosphere/isession.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/isession.hpp @@ -187,6 +187,10 @@ class ISession : public IWaitable { ipcAddRecvStatic(&c_for_reply, this->pointer_buffer.data(), this->pointer_buffer.size(), 0); ipcPrepareHeader(&c_for_reply, 0); + /* Fix libnx bug in serverside C descriptor handling. */ + ((u32 *)armGetTls())[1] &= 0xFFFFC3FF; + ((u32 *)armGetTls())[1] |= (2) << 10; + if (R_SUCCEEDED(rc = svcReplyAndReceive(&handle_index, &this->server_handle, 1, 0, U64_MAX))) { if (handle_index != 0) { /* TODO: Panic? */