summaryrefslogtreecommitdiff
path: root/Kernel/FileSystem
diff options
context:
space:
mode:
authorFreakness109 <freakness109@gmail.com>2022-12-16 22:21:18 +0100
committerSam Atkins <atkinssj@gmail.com>2022-12-17 09:37:04 +0000
commit1f1e58ed75613dfa9f549c0d205ecb0e57ac8ebb (patch)
treebc9c8e4fc455655c61a4c4e92bcf3ec8ec7530b7 /Kernel/FileSystem
parent0dd8066a79d3ef41eb9af526e1f346673d4ceb32 (diff)
downloadserenity-1f1e58ed75613dfa9f549c0d205ecb0e57ac8ebb.zip
Kernel/Plan9FS: Propagate errors in Plan9FSMessage::append_data
Diffstat (limited to 'Kernel/FileSystem')
-rw-r--r--Kernel/FileSystem/Plan9FS/Inode.cpp2
-rw-r--r--Kernel/FileSystem/Plan9FS/Message.cpp6
-rw-r--r--Kernel/FileSystem/Plan9FS/Message.h2
3 files changed, 5 insertions, 5 deletions
diff --git a/Kernel/FileSystem/Plan9FS/Inode.cpp b/Kernel/FileSystem/Plan9FS/Inode.cpp
index 9dc620a66a..05093a3945 100644
--- a/Kernel/FileSystem/Plan9FS/Inode.cpp
+++ b/Kernel/FileSystem/Plan9FS/Inode.cpp
@@ -111,7 +111,7 @@ ErrorOr<size_t> Plan9FSInode::write_bytes_locked(off_t offset, size_t size, User
Plan9FSMessage message { fs(), Plan9FSMessage::Type::Twrite };
message << fid() << (u64)offset;
- message.append_data(data_copy->view());
+ TRY(message.append_data(data_copy->view()));
TRY(fs().post_message_and_wait_for_a_reply(message));
u32 nwritten;
diff --git a/Kernel/FileSystem/Plan9FS/Message.cpp b/Kernel/FileSystem/Plan9FS/Message.cpp
index 733e6cef5d..69272b63f4 100644
--- a/Kernel/FileSystem/Plan9FS/Message.cpp
+++ b/Kernel/FileSystem/Plan9FS/Message.cpp
@@ -38,11 +38,11 @@ Plan9FSMessage& Plan9FSMessage::operator<<(StringView string)
return *this;
}
-void Plan9FSMessage::append_data(StringView data)
+ErrorOr<void> Plan9FSMessage::append_data(StringView data)
{
*this << static_cast<u32>(data.length());
- // FIXME: Handle append failure.
- (void)m_builder.append(data);
+ TRY(m_builder.append(data));
+ return {};
}
Plan9FSMessage::Decoder& Plan9FSMessage::Decoder::operator>>(u8& number)
diff --git a/Kernel/FileSystem/Plan9FS/Message.h b/Kernel/FileSystem/Plan9FS/Message.h
index d5e178a0d0..41d5f6f91d 100644
--- a/Kernel/FileSystem/Plan9FS/Message.h
+++ b/Kernel/FileSystem/Plan9FS/Message.h
@@ -135,7 +135,7 @@ public:
Plan9FSMessage& operator<<(u32);
Plan9FSMessage& operator<<(u64);
Plan9FSMessage& operator<<(StringView);
- void append_data(StringView);
+ ErrorOr<void> append_data(StringView);
template<typename T>
Plan9FSMessage& operator>>(T& t)