mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:07:34 +00:00
Kernel/Plan9FS: Propagate errors in Plan9FSMessage::append_data
This commit is contained in:
parent
0dd8066a79
commit
1f1e58ed75
3 changed files with 5 additions and 5 deletions
|
@ -111,7 +111,7 @@ ErrorOr<size_t> Plan9FSInode::write_bytes_locked(off_t offset, size_t size, User
|
||||||
|
|
||||||
Plan9FSMessage message { fs(), Plan9FSMessage::Type::Twrite };
|
Plan9FSMessage message { fs(), Plan9FSMessage::Type::Twrite };
|
||||||
message << fid() << (u64)offset;
|
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));
|
TRY(fs().post_message_and_wait_for_a_reply(message));
|
||||||
|
|
||||||
u32 nwritten;
|
u32 nwritten;
|
||||||
|
|
|
@ -38,11 +38,11 @@ Plan9FSMessage& Plan9FSMessage::operator<<(StringView string)
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Plan9FSMessage::append_data(StringView data)
|
ErrorOr<void> Plan9FSMessage::append_data(StringView data)
|
||||||
{
|
{
|
||||||
*this << static_cast<u32>(data.length());
|
*this << static_cast<u32>(data.length());
|
||||||
// FIXME: Handle append failure.
|
TRY(m_builder.append(data));
|
||||||
(void)m_builder.append(data);
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
Plan9FSMessage::Decoder& Plan9FSMessage::Decoder::operator>>(u8& number)
|
Plan9FSMessage::Decoder& Plan9FSMessage::Decoder::operator>>(u8& number)
|
||||||
|
|
|
@ -135,7 +135,7 @@ public:
|
||||||
Plan9FSMessage& operator<<(u32);
|
Plan9FSMessage& operator<<(u32);
|
||||||
Plan9FSMessage& operator<<(u64);
|
Plan9FSMessage& operator<<(u64);
|
||||||
Plan9FSMessage& operator<<(StringView);
|
Plan9FSMessage& operator<<(StringView);
|
||||||
void append_data(StringView);
|
ErrorOr<void> append_data(StringView);
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Plan9FSMessage& operator>>(T& t)
|
Plan9FSMessage& operator>>(T& t)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue