mirror of
https://github.com/RGBCube/serenity
synced 2025-05-30 21:48:11 +00:00
Kernel: Make KBufferBuilder::append() & friends return KResult
This allows callers to react to a failed append (due to OOM.)
This commit is contained in:
parent
b096e85777
commit
2065ced8f6
7 changed files with 63 additions and 42 deletions
|
@ -57,7 +57,7 @@ KResultOr<NonnullOwnPtr<KBuffer>> Inode::read_entire(FileDescription* descriptio
|
|||
VERIFY(nread <= sizeof(buffer));
|
||||
if (nread == 0)
|
||||
break;
|
||||
builder.append((const char*)buffer, nread);
|
||||
TRY(builder.append((const char*)buffer, nread));
|
||||
offset += nread;
|
||||
if (nread < sizeof(buffer))
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue