diff options
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibSQL/Heap.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/Userland/Libraries/LibSQL/Heap.cpp b/Userland/Libraries/LibSQL/Heap.cpp index 9888ea7274..6b897a4fed 100644 --- a/Userland/Libraries/LibSQL/Heap.cpp +++ b/Userland/Libraries/LibSQL/Heap.cpp @@ -91,11 +91,9 @@ ErrorOr<ByteBuffer> Heap::read_block(u32 block) TRY(seek_block(block)); auto buffer = TRY(ByteBuffer::create_uninitialized(BLOCKSIZE)); - // FIXME: This should read the entire span. - auto bytes = TRY(m_file->read_some(buffer)); + TRY(m_file->read_until_filled(buffer)); - dbgln_if(SQL_DEBUG, "{:hex-dump}", bytes.trim(8)); - TRY(buffer.try_resize(bytes.size())); + dbgln_if(SQL_DEBUG, "{:hex-dump}", buffer.bytes().trim(8)); return buffer; } @@ -124,8 +122,7 @@ ErrorOr<void> Heap::write_block(u32 block, ByteBuffer& buffer) } dbgln_if(SQL_DEBUG, "{:hex-dump}", buffer.bytes().trim(8)); - // FIXME: This should write the entire span. - TRY(m_file->write_some(buffer)); + TRY(m_file->write_until_depleted(buffer)); if (block == m_end_of_file) m_end_of_file++; |