mirror of
https://review.haiku-os.org/haiku
synced 2025-02-23 05:58:31 +01:00
* vfs_stat_node_ref(): Added missing initialization of
stat::st_{dev,ino}. * stat::st_rdev is unused, but at least initialize it with some deterministing value. This makes Perl's lib/File/stat.t test happy. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28333 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
7e47a4ee00
commit
e967b93ab6
@ -4403,6 +4403,7 @@ vfs_stat_vnode(struct vnode *vnode, struct stat *stat)
|
||||
if (status == B_OK) {
|
||||
stat->st_dev = vnode->device;
|
||||
stat->st_ino = vnode->id;
|
||||
stat->st_rdev = -1;
|
||||
}
|
||||
|
||||
return status;
|
||||
@ -4418,6 +4419,14 @@ vfs_stat_node_ref(dev_t device, ino_t inode, struct stat *stat)
|
||||
return status;
|
||||
|
||||
status = FS_CALL(vnode, read_stat, stat);
|
||||
|
||||
// fill in the st_dev and st_ino fields
|
||||
if (status == B_OK) {
|
||||
stat->st_dev = vnode->device;
|
||||
stat->st_ino = vnode->id;
|
||||
stat->st_rdev = -1;
|
||||
}
|
||||
|
||||
put_vnode(vnode);
|
||||
return status;
|
||||
}
|
||||
@ -5973,6 +5982,7 @@ common_read_stat(struct file_descriptor *descriptor, struct stat *stat)
|
||||
if (status == B_OK) {
|
||||
stat->st_dev = vnode->device;
|
||||
stat->st_ino = vnode->id;
|
||||
stat->st_rdev = -1;
|
||||
}
|
||||
|
||||
return status;
|
||||
@ -6011,6 +6021,7 @@ common_path_read_stat(int fd, char *path, bool traverseLeafLink,
|
||||
if (status == B_OK) {
|
||||
stat->st_dev = vnode->device;
|
||||
stat->st_ino = vnode->id;
|
||||
stat->st_rdev = -1;
|
||||
}
|
||||
|
||||
put_vnode(vnode);
|
||||
|
Loading…
x
Reference in New Issue
Block a user