mirror of
https://github.com/RGBCube/serenity
synced 2025-05-15 09:34:59 +00:00
Kernel: Use TRY() in DevFSLinkInode::write_bytes()
This commit is contained in:
parent
667a39df6b
commit
100b3835f0
1 changed files with 2 additions and 4 deletions
|
@ -175,14 +175,12 @@ InodeMetadata DevFSLinkInode::metadata() const
|
|||
|
||||
KResultOr<size_t> DevFSLinkInode::write_bytes(off_t offset, size_t count, UserOrKernelBuffer const& buffer, FileDescription*)
|
||||
{
|
||||
auto kstring_or_error = buffer.try_copy_into_kstring(count);
|
||||
if (kstring_or_error.is_error())
|
||||
return kstring_or_error.error();
|
||||
auto new_string = TRY(buffer.try_copy_into_kstring(count));
|
||||
|
||||
MutexLocker locker(m_inode_lock);
|
||||
VERIFY(offset == 0);
|
||||
VERIFY(buffer.is_kernel_buffer());
|
||||
m_link = kstring_or_error.release_value();
|
||||
m_link = move(new_string);
|
||||
return count;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue