mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
Kernel: Use m_inode to stat in FileDescription::stat() if available
This is necessary since the Device class does not hold a reference to its inode (because there could be multiple), and thus doesn't override File::stat(). For simplicity, we should just always stat via the inode if there is one, since that shouldn't ever be the wrong thing. This partially reverts #7867.
This commit is contained in:
parent
54a33c45bb
commit
90e229c9b5
Notes:
sideshowbarker
2024-07-18 12:26:12 +09:00
Author: https://github.com/MaxWipfli Commit: https://github.com/SerenityOS/serenity/commit/90e229c9b57 Pull-request: https://github.com/SerenityOS/serenity/pull/7988 Reviewed-by: https://github.com/awesomekling
1 changed files with 3 additions and 0 deletions
|
@ -110,6 +110,9 @@ Thread::FileBlocker::BlockFlags FileDescription::should_unblock(Thread::FileBloc
|
|||
KResult FileDescription::stat(::stat& buffer)
|
||||
{
|
||||
Locker 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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue