mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-22 23:02:47 +01:00
Merge pull request #1318 from lioncash/errors-sm
services/sm: Amend error code constants
This commit is contained in:
commit
fc46183e03
2 changed files with 6 additions and 8 deletions
|
@ -15,6 +15,10 @@
|
||||||
|
|
||||||
namespace Service::SM {
|
namespace Service::SM {
|
||||||
|
|
||||||
|
constexpr ResultCode ERR_ALREADY_REGISTERED(ErrorModule::SM, 4);
|
||||||
|
constexpr ResultCode ERR_INVALID_NAME(ErrorModule::SM, 6);
|
||||||
|
constexpr ResultCode ERR_SERVICE_NOT_REGISTERED(ErrorModule::SM, 7);
|
||||||
|
|
||||||
ServiceManager::ServiceManager() = default;
|
ServiceManager::ServiceManager() = default;
|
||||||
ServiceManager::~ServiceManager() = default;
|
ServiceManager::~ServiceManager() = default;
|
||||||
|
|
||||||
|
@ -24,10 +28,10 @@ void ServiceManager::InvokeControlRequest(Kernel::HLERequestContext& context) {
|
||||||
|
|
||||||
static ResultCode ValidateServiceName(const std::string& name) {
|
static ResultCode ValidateServiceName(const std::string& name) {
|
||||||
if (name.size() <= 0 || name.size() > 8) {
|
if (name.size() <= 0 || name.size() > 8) {
|
||||||
return ERR_INVALID_NAME_SIZE;
|
return ERR_INVALID_NAME;
|
||||||
}
|
}
|
||||||
if (name.find('\0') != std::string::npos) {
|
if (name.find('\0') != std::string::npos) {
|
||||||
return ERR_NAME_CONTAINS_NUL;
|
return ERR_INVALID_NAME;
|
||||||
}
|
}
|
||||||
return RESULT_SUCCESS;
|
return RESULT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,12 +36,6 @@ private:
|
||||||
std::shared_ptr<ServiceManager> service_manager;
|
std::shared_ptr<ServiceManager> service_manager;
|
||||||
};
|
};
|
||||||
|
|
||||||
constexpr ResultCode ERR_SERVICE_NOT_REGISTERED(-1);
|
|
||||||
constexpr ResultCode ERR_MAX_CONNECTIONS_REACHED(-1);
|
|
||||||
constexpr ResultCode ERR_INVALID_NAME_SIZE(-1);
|
|
||||||
constexpr ResultCode ERR_NAME_CONTAINS_NUL(-1);
|
|
||||||
constexpr ResultCode ERR_ALREADY_REGISTERED(-1);
|
|
||||||
|
|
||||||
class ServiceManager {
|
class ServiceManager {
|
||||||
public:
|
public:
|
||||||
static void InstallInterfaces(std::shared_ptr<ServiceManager> self);
|
static void InstallInterfaces(std::shared_ptr<ServiceManager> self);
|
||||||
|
|
Loading…
Reference in a new issue