mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +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
Notes:
sideshowbarker
2024-07-17 01:42:03 +09:00
Author: https://github.com/LucasChollet Commit: https://github.com/SerenityOS/serenity/commit/56512caa73 Pull-request: https://github.com/SerenityOS/serenity/pull/16544 Reviewed-by: https://github.com/ADKaster ✅ Reviewed-by: https://github.com/timschumi ✅
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…
Reference in a new issue