diff options
author | Mat M <mathew1800@gmail.com> | 2020-04-29 03:41:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-29 03:41:13 +0200 |
commit | c3c3e0726393775b2e07077bc24f7c32c7561ce4 (patch) | |
tree | 731e4602fa69ac1eba0aaedc240b0434af61882c /src/core/hle/service/sm/sm.cpp | |
parent | Merge pull request #3783 from lioncash/pointer (diff) | |
parent | Don't fail silently for vi, sm, set and ns services (diff) | |
download | yuzu-c3c3e0726393775b2e07077bc24f7c32c7561ce4.tar yuzu-c3c3e0726393775b2e07077bc24f7c32c7561ce4.tar.gz yuzu-c3c3e0726393775b2e07077bc24f7c32c7561ce4.tar.bz2 yuzu-c3c3e0726393775b2e07077bc24f7c32c7561ce4.tar.lz yuzu-c3c3e0726393775b2e07077bc24f7c32c7561ce4.tar.xz yuzu-c3c3e0726393775b2e07077bc24f7c32c7561ce4.tar.zst yuzu-c3c3e0726393775b2e07077bc24f7c32c7561ce4.zip |
Diffstat (limited to 'src/core/hle/service/sm/sm.cpp')
-rw-r--r-- | src/core/hle/service/sm/sm.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/core/hle/service/sm/sm.cpp b/src/core/hle/service/sm/sm.cpp index 88909504d..6ada13be4 100644 --- a/src/core/hle/service/sm/sm.cpp +++ b/src/core/hle/service/sm/sm.cpp @@ -28,9 +28,11 @@ void ServiceManager::InvokeControlRequest(Kernel::HLERequestContext& context) { static ResultCode ValidateServiceName(const std::string& name) { if (name.size() <= 0 || name.size() > 8) { + LOG_ERROR(Service_SM, "Invalid service name! service={}", name); return ERR_INVALID_NAME; } if (name.find('\0') != std::string::npos) { + LOG_ERROR(Service_SM, "A non null terminated service was passed"); return ERR_INVALID_NAME; } return RESULT_SUCCESS; @@ -51,8 +53,10 @@ ResultVal<std::shared_ptr<Kernel::ServerPort>> ServiceManager::RegisterService( CASCADE_CODE(ValidateServiceName(name)); - if (registered_services.find(name) != registered_services.end()) + if (registered_services.find(name) != registered_services.end()) { + LOG_ERROR(Service_SM, "Service is already registered! service={}", name); return ERR_ALREADY_REGISTERED; + } auto& kernel = Core::System::GetInstance().Kernel(); auto [server_port, client_port] = @@ -66,9 +70,10 @@ ResultCode ServiceManager::UnregisterService(const std::string& name) { CASCADE_CODE(ValidateServiceName(name)); const auto iter = registered_services.find(name); - if (iter == registered_services.end()) + if (iter == registered_services.end()) { + LOG_ERROR(Service_SM, "Server is not registered! service={}", name); return ERR_SERVICE_NOT_REGISTERED; - + } registered_services.erase(iter); return RESULT_SUCCESS; } @@ -79,6 +84,7 @@ ResultVal<std::shared_ptr<Kernel::ClientPort>> ServiceManager::GetServicePort( CASCADE_CODE(ValidateServiceName(name)); auto it = registered_services.find(name); if (it == registered_services.end()) { + LOG_ERROR(Service_SM, "Server is not registered! service={}", name); return ERR_SERVICE_NOT_REGISTERED; } |