Kernel: Oops, I mixed up st_dev and st_rdev in struct stat.

This commit is contained in:
Andreas Kling 2019-02-03 06:23:10 +01:00
parent e895d6c48e
commit 0c9a2b1430
Notes: sideshowbarker 2024-07-19 15:53:05 +09:00
2 changed files with 3 additions and 3 deletions

View file

@ -91,13 +91,13 @@ int FileDescriptor::fstat(stat* buffer)
if (!metadata.is_valid())
return -EIO;
buffer->st_dev = encoded_device(metadata.major_device, metadata.minor_device);
buffer->st_rdev = encoded_device(metadata.major_device, metadata.minor_device);
buffer->st_ino = metadata.inode.index();
buffer->st_mode = metadata.mode;
buffer->st_nlink = metadata.link_count;
buffer->st_uid = metadata.uid;
buffer->st_gid = metadata.gid;
buffer->st_rdev = 0; // FIXME
buffer->st_dev = 0; // FIXME
buffer->st_size = metadata.size;
buffer->st_blksize = metadata.block_size;
buffer->st_blocks = metadata.block_count;

View file

@ -159,7 +159,7 @@ int do_dir(const char* path)
printf(" %4u %4u", st.st_uid, st.st_gid);
if (S_ISCHR(st.st_mode))
printf(" %4u,%4u ", major(st.st_dev), minor(st.st_dev));
printf(" %4u,%4u ", major(st.st_rdev), minor(st.st_rdev));
else
printf(" %10u ", st.st_size);