mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 22:38:51 +00:00
Make stat() work on device files again.
FileDescriptor will now keep a pointer to the original inode even after opening it resolves to a character device. Fixed up /bin/ls to display major and minor device numbers instead of size for device files.
This commit is contained in:
parent
c3cc318028
commit
c4fce9b3f9
Notes:
sideshowbarker
2024-07-19 15:54:41 +09:00
Author: https://github.com/awesomekling
Commit: c4fce9b3f9
8 changed files with 25 additions and 10 deletions
|
@ -360,7 +360,7 @@ InodeMetadata Ext2FSInode::metadata() const
|
|||
if (isBlockDevice(m_raw_inode.i_mode) || isCharacterDevice(m_raw_inode.i_mode)) {
|
||||
unsigned dev = m_raw_inode.i_block[0];
|
||||
metadata.majorDevice = (dev & 0xfff00) >> 8;
|
||||
metadata.minorDevice= (dev & 0xff) | ((dev >> 12) & 0xfff00);
|
||||
metadata.minorDevice = (dev & 0xff) | ((dev >> 12) & 0xfff00);
|
||||
}
|
||||
return metadata;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue