mirror of
https://github.com/RGBCube/serenity
synced 2025-05-15 09:24:57 +00:00
Kernel: Remove various other uses of ssize_t
This commit is contained in:
parent
ca3cae81eb
commit
bc3076f894
33 changed files with 123 additions and 129 deletions
|
@ -51,7 +51,7 @@ KResultOr<NonnullOwnPtr<KBuffer>> Inode::read_entire(FileDescription* descriptio
|
|||
{
|
||||
KBufferBuilder builder;
|
||||
|
||||
ssize_t nread;
|
||||
size_t nread;
|
||||
u8 buffer[4096];
|
||||
off_t offset = 0;
|
||||
for (;;) {
|
||||
|
@ -60,18 +60,14 @@ KResultOr<NonnullOwnPtr<KBuffer>> Inode::read_entire(FileDescription* descriptio
|
|||
if (result.is_error())
|
||||
return result.error();
|
||||
nread = result.value();
|
||||
VERIFY(nread <= (ssize_t)sizeof(buffer));
|
||||
VERIFY(nread <= sizeof(buffer));
|
||||
if (nread <= 0)
|
||||
break;
|
||||
builder.append((const char*)buffer, nread);
|
||||
offset += nread;
|
||||
if (nread < (ssize_t)sizeof(buffer))
|
||||
if (nread < sizeof(buffer))
|
||||
break;
|
||||
}
|
||||
if (nread < 0) {
|
||||
dmesgln("Inode::read_entire: Error: {}", nread);
|
||||
return KResult((ErrnoCode)-nread);
|
||||
}
|
||||
|
||||
auto entire_file = builder.build();
|
||||
if (!entire_file)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue