LM: Don't create an unnecessary port in Initialize.
This commit is contained in:
parent
67c43e9200
commit
1a9c96e4de
|
@ -146,18 +146,16 @@ void InstallInterfaces(SM::ServiceManager& service_manager) {
|
||||||
* 0: ResultCode
|
* 0: ResultCode
|
||||||
*/
|
*/
|
||||||
void LM::Initialize(Kernel::HLERequestContext& ctx) {
|
void LM::Initialize(Kernel::HLERequestContext& ctx) {
|
||||||
auto client_port = std::make_shared<Logger>()->CreatePort();
|
auto logger = std::make_shared<Logger>();
|
||||||
auto session = client_port->Connect();
|
auto sessions = Kernel::ServerSession::CreateSessionPair(logger->GetServiceName());
|
||||||
if (session.Succeeded()) {
|
auto server = std::get<Kernel::SharedPtr<Kernel::ServerSession>>(sessions);
|
||||||
LOG_DEBUG(Service_SM, "called, initialized logger -> session=%u",
|
auto client = std::get<Kernel::SharedPtr<Kernel::ClientSession>>(sessions);
|
||||||
(*session)->GetObjectId());
|
logger->ClientConnected(server);
|
||||||
IPC::RequestBuilder rb{ctx, 2, 0, 1};
|
|
||||||
rb.Push(RESULT_SUCCESS);
|
LOG_DEBUG(Service_SM, "called, initialized logger -> session=%u", client->GetObjectId());
|
||||||
rb.PushMoveObjects(std::move(session).Unwrap());
|
IPC::RequestBuilder rb{ctx, 2, 0, 1};
|
||||||
registered_loggers.emplace_back(std::move(client_port));
|
rb.Push(RESULT_SUCCESS);
|
||||||
} else {
|
rb.PushMoveObjects(std::move(client));
|
||||||
UNIMPLEMENTED();
|
|
||||||
}
|
|
||||||
|
|
||||||
LOG_INFO(Service_SM, "called");
|
LOG_INFO(Service_SM, "called");
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "core/hle/kernel/client_port.h"
|
|
||||||
#include "core/hle/kernel/kernel.h"
|
#include "core/hle/kernel/kernel.h"
|
||||||
#include "core/hle/service/service.h"
|
#include "core/hle/service/service.h"
|
||||||
|
|
||||||
|
@ -19,8 +18,6 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Initialize(Kernel::HLERequestContext& ctx);
|
void Initialize(Kernel::HLERequestContext& ctx);
|
||||||
|
|
||||||
std::vector<Kernel::SharedPtr<Kernel::ClientPort>> registered_loggers;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Registers all LM services with the specified service manager.
|
/// Registers all LM services with the specified service manager.
|
||||||
|
|
Loading…
Reference in New Issue