Don't cast inode number or file size down to long or unsigned.
Since ino_t size is about to change to 64-bits, casts to long would truncate 64-bit numbers on 32-bit archs. Sponsored by: Google Summer of Code 2011
This commit is contained in:
parent
1f12bc49ad
commit
6419400ed4
@ -84,7 +84,7 @@ isofs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn)
|
||||
}
|
||||
vn->vn_fsid = dev2udev(kd, mnt.im_dev);
|
||||
vn->vn_mode = (mode_t)isonode.inode.iso_mode;
|
||||
vn->vn_fileid = (long)isonode.i_number;
|
||||
vn->vn_size = (u_long)isonode.i_size;
|
||||
vn->vn_fileid = isonode.i_number;
|
||||
vn->vn_size = isonode.i_size;
|
||||
return (0);
|
||||
}
|
||||
|
@ -99,9 +99,9 @@ ufs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn)
|
||||
* comparisons
|
||||
*/
|
||||
vn->vn_fsid = dev2udev(kd, inode.i_dev);
|
||||
vn->vn_fileid = (long)inode.i_number;
|
||||
vn->vn_fileid = inode.i_number;
|
||||
vn->vn_mode = (mode_t)inode.i_mode;
|
||||
vn->vn_size = (u_long)inode.i_size;
|
||||
vn->vn_size = inode.i_size;
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
@ -244,7 +244,7 @@ print_file_info(struct procstat *procstat, struct filestat *fst,
|
||||
for (d = devs; d != NULL; d = d->next)
|
||||
if (d->fsid == vn.vn_fsid) {
|
||||
fsmatch = 1;
|
||||
if ((unsigned)d->ino == vn.vn_fileid) {
|
||||
if (d->ino == vn.vn_fileid) {
|
||||
filename = d->name;
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user