diff options
author | Andreas Kling <kling@serenityos.org> | 2021-09-07 15:54:23 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-09-07 15:54:23 +0200 |
commit | 300402cc142aaa4e481801146b47b1d0f72c0647 (patch) | |
tree | 235fc407db0614c3c1b072f6fabed04641f60b5e /Kernel/FileSystem/Plan9FileSystem.cpp | |
parent | be613b9ef6ceea86aa511d4f411c8638b52e9d22 (diff) | |
download | serenity-300402cc142aaa4e481801146b47b1d0f72c0647.zip |
Kernel: Make it possible for KBufferBuilder creation to fail
This patch adds KBufferBuilder::try_create() and treats it like anything
else that can fail. And so, failure to allocate the initial internal
buffer of the builder will now propagate an ENOMEM to the caller. :^)
Diffstat (limited to 'Kernel/FileSystem/Plan9FileSystem.cpp')
-rw-r--r-- | Kernel/FileSystem/Plan9FileSystem.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/FileSystem/Plan9FileSystem.cpp b/Kernel/FileSystem/Plan9FileSystem.cpp index 0cdca6caa1..43bd3a4870 100644 --- a/Kernel/FileSystem/Plan9FileSystem.cpp +++ b/Kernel/FileSystem/Plan9FileSystem.cpp @@ -323,7 +323,7 @@ StringView Plan9FS::Message::Decoder::read_data() } Plan9FS::Message::Message(Plan9FS& fs, Type type) - : m_builder() + : m_builder(KBufferBuilder::try_create().release_value()) // FIXME: Don't assume KBufferBuilder allocation success. , m_tag(fs.allocate_tag()) , m_type(type) , m_have_been_built(false) |