mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-15 22:54:00 +00:00
kernel/server_port: Change error case return value in Accept() to ERR_NOT_FOUND
This is what the kernel does in this instance.
This commit is contained in:
parent
afb7e5cc05
commit
b703aba622
2 changed files with 1 additions and 3 deletions
|
@ -69,7 +69,5 @@ constexpr ResultCode ERR_NOT_AUTHORIZED(-1);
|
||||||
constexpr ResultCode ERR_INVALID_HANDLE_OS(-1);
|
constexpr ResultCode ERR_INVALID_HANDLE_OS(-1);
|
||||||
constexpr ResultCode ERR_NOT_FOUND(ErrorModule::Kernel, ErrCodes::NoSuchEntry);
|
constexpr ResultCode ERR_NOT_FOUND(ErrorModule::Kernel, ErrCodes::NoSuchEntry);
|
||||||
constexpr ResultCode RESULT_TIMEOUT(ErrorModule::Kernel, ErrCodes::Timeout);
|
constexpr ResultCode RESULT_TIMEOUT(ErrorModule::Kernel, ErrCodes::Timeout);
|
||||||
/// Returned when Accept() is called on a port with no sessions to be accepted.
|
|
||||||
constexpr ResultCode ERR_NO_PENDING_SESSIONS(-1);
|
|
||||||
|
|
||||||
} // namespace Kernel
|
} // namespace Kernel
|
||||||
|
|
|
@ -18,7 +18,7 @@ ServerPort::~ServerPort() = default;
|
||||||
|
|
||||||
ResultVal<SharedPtr<ServerSession>> ServerPort::Accept() {
|
ResultVal<SharedPtr<ServerSession>> ServerPort::Accept() {
|
||||||
if (pending_sessions.empty()) {
|
if (pending_sessions.empty()) {
|
||||||
return ERR_NO_PENDING_SESSIONS;
|
return ERR_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto session = std::move(pending_sessions.back());
|
auto session = std::move(pending_sessions.back());
|
||||||
|
|
Loading…
Reference in a new issue