summaryrefslogtreecommitdiffstats
path: root/lib/libprocstat
diff options
context:
space:
mode:
authorgleb <gleb@FreeBSD.org>2012-05-18 10:15:46 +0000
committergleb <gleb@FreeBSD.org>2012-05-18 10:15:46 +0000
commit6419400ed44575175ae5e3af7f6711f9b075ef55 (patch)
tree1ddd195e1d91efe3faf7942a1bcf5d0b39229b08 /lib/libprocstat
parent1f12bc49add80da7d6b25b8c5132d62e32cb9b39 (diff)
downloadFreeBSD-src-6419400ed44575175ae5e3af7f6711f9b075ef55.zip
FreeBSD-src-6419400ed44575175ae5e3af7f6711f9b075ef55.tar.gz
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
Diffstat (limited to 'lib/libprocstat')
-rw-r--r--lib/libprocstat/cd9660.c4
-rw-r--r--lib/libprocstat/common_kvm.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/libprocstat/cd9660.c b/lib/libprocstat/cd9660.c
index 95882be..ab95e2a 100644
--- a/lib/libprocstat/cd9660.c
+++ b/lib/libprocstat/cd9660.c
@@ -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);
}
diff --git a/lib/libprocstat/common_kvm.c b/lib/libprocstat/common_kvm.c
index 63302bc..be05980 100644
--- a/lib/libprocstat/common_kvm.c
+++ b/lib/libprocstat/common_kvm.c
@@ -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);
}
OpenPOWER on IntegriCloud