From 4711347dd2324401411a7ae98286b9d295f7abba Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Tue, 17 Aug 2004 20:34:38 +0000 Subject: [PATCH] Properly record and print 64 bit file sizes, do not truncate the file size to 32 bits. --- usr.bin/fstat/cd9660.c | 4 ++-- usr.bin/fstat/fstat.c | 6 +++--- usr.bin/fstat/fstat.h | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/usr.bin/fstat/cd9660.c b/usr.bin/fstat/cd9660.c index 185974e665..b1af572d1e 100644 --- a/usr.bin/fstat/cd9660.c +++ b/usr.bin/fstat/cd9660.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.bin/fstat/cd9660.c,v 1.1.2.3 2001/11/21 10:49:37 dwmalone Exp $ - * $DragonFly: src/usr.bin/fstat/cd9660.c,v 1.4 2003/10/04 20:36:44 hmp Exp $ + * $DragonFly: src/usr.bin/fstat/cd9660.c,v 1.5 2004/08/17 20:34:38 dillon Exp $ */ /* @@ -73,7 +73,7 @@ isofs_filestat(struct vnode *vp, struct filestat *fsp) fsp->rdev = isonode.i_dev; fsp->fileid = (long)isonode.i_number; - fsp->size = (u_long)isonode.i_size; + fsp->size = isonode.i_size; return 1; } diff --git a/usr.bin/fstat/fstat.c b/usr.bin/fstat/fstat.c index a99fdc0cd8..480a4d0b50 100644 --- a/usr.bin/fstat/fstat.c +++ b/usr.bin/fstat/fstat.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1988, 1993 The Regents of the University of California. All rights reserved. * @(#)fstat.c 8.3 (Berkeley) 5/2/95 * $FreeBSD: src/usr.bin/fstat/fstat.c,v 1.21.2.7 2001/11/21 10:49:37 dwmalone Exp $ - * $DragonFly: src/usr.bin/fstat/fstat.c,v 1.7 2003/11/21 22:46:14 dillon Exp $ + * $DragonFly: src/usr.bin/fstat/fstat.c,v 1.8 2004/08/17 20:34:38 dillon Exp $ */ #define _KERNEL_STRUCTURES @@ -520,7 +520,7 @@ vtrans(struct vnode *vp, int i, int flag) break; } default: - printf(" %6lu", fst.size); + printf(" %6llu", fst.size); } rw[0] = '\0'; if (flag & FREAD) @@ -551,7 +551,7 @@ ufs_filestat(struct vnode *vp, struct filestat *fsp) fsp->fsid = dev2udev(inode.i_dev); fsp->fileid = (long)inode.i_number; fsp->mode = (mode_t)inode.i_mode; - fsp->size = (u_long)inode.i_size; + fsp->size = inode.i_size; fsp->rdev = inode.i_rdev; return 1; diff --git a/usr.bin/fstat/fstat.h b/usr.bin/fstat/fstat.h index 7c716f9030..def0f60f77 100644 --- a/usr.bin/fstat/fstat.h +++ b/usr.bin/fstat/fstat.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.bin/fstat/fstat.h,v 1.1.2.1 2000/07/02 10:20:25 ps Exp $ - * $DragonFly: src/usr.bin/fstat/fstat.h,v 1.3 2003/11/03 19:31:29 eirikn Exp $ + * $DragonFly: src/usr.bin/fstat/fstat.h,v 1.4 2004/08/17 20:34:38 dillon Exp $ */ #ifndef __FSTAT_H__ @@ -56,7 +56,7 @@ struct filestat { long fsid; long fileid; mode_t mode; - u_long size; + long long size; dev_t rdev; }; -- 2.41.0