mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 12:05:08 +00:00
AK: Make Vector::try_* functions return ErrorOr<void>
Instead of signalling allocation failure with a bool return value (false), we now use ErrorOr<void> and return ENOMEM as appropriate. This allows us to use TRY() and MUST() with Vector. :^)
This commit is contained in:
parent
cd49f30bea
commit
88b6428c25
16 changed files with 98 additions and 152 deletions
|
@ -71,8 +71,7 @@ ErrorOr<void> Socket::queue_connection_from(NonnullRefPtr<Socket> peer)
|
|||
MutexLocker locker(mutex());
|
||||
if (m_pending.size() >= m_backlog)
|
||||
return set_so_error(ECONNREFUSED);
|
||||
if (!m_pending.try_append(peer))
|
||||
return set_so_error(ENOMEM);
|
||||
SOCKET_TRY(m_pending.try_append(peer));
|
||||
evaluate_block_conditions();
|
||||
return {};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue