mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:48:14 +00:00
Kernel: Make File::stat() & friends return Error<struct stat>
Instead of making the caller provide a stat buffer, let's just return one as a value.
This commit is contained in:
parent
1f2d0d0ad4
commit
0ae8702692
10 changed files with 19 additions and 20 deletions
|
@ -97,13 +97,13 @@ Thread::FileBlocker::BlockFlags OpenFileDescription::should_unblock(Thread::File
|
|||
return unblock_flags;
|
||||
}
|
||||
|
||||
ErrorOr<void> OpenFileDescription::stat(::stat& buffer)
|
||||
ErrorOr<struct stat> OpenFileDescription::stat()
|
||||
{
|
||||
MutexLocker locker(m_lock);
|
||||
// FIXME: This is due to the Device class not overriding File::stat().
|
||||
if (m_inode)
|
||||
return m_inode->metadata().stat(buffer);
|
||||
return m_file->stat(buffer);
|
||||
return m_inode->metadata().stat();
|
||||
return m_file->stat();
|
||||
}
|
||||
|
||||
ErrorOr<off_t> OpenFileDescription::seek(off_t offset, int whence)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue