mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 21:47:45 +00:00
LibCore: Don't reject an empty buffer with ENOBUFS
Instead, we just return the empty buffer.
This commit is contained in:
parent
4402720a15
commit
56512caa73
1 changed files with 3 additions and 3 deletions
|
@ -657,8 +657,8 @@ public:
|
|||
{
|
||||
if (!stream().is_open())
|
||||
return Error::from_errno(ENOTCONN);
|
||||
if (!buffer.size())
|
||||
return Error::from_errno(ENOBUFS);
|
||||
if (buffer.is_empty())
|
||||
return buffer;
|
||||
|
||||
// Fill the internal buffer if it has run dry.
|
||||
if (m_buffer.used_space() == 0)
|
||||
|
@ -688,7 +688,7 @@ public:
|
|||
return Error::from_errno(ENOTCONN);
|
||||
|
||||
if (buffer.is_empty())
|
||||
return Error::from_errno(ENOBUFS);
|
||||
return buffer;
|
||||
|
||||
auto const candidate = TRY(find_and_populate_until_any_of(candidates, buffer.size()));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue