diff options
author | 2000-01-01 23:50:59 +0000 | |
---|---|---|
committer | 2000-01-01 23:50:59 +0000 | |
commit | e960b9a34d0d5955da33f84221ded84db9a1db6a (patch) | |
tree | d914d62454f6ec5eaae0ad66a3b2e1937885c731 | |
parent | Fix 2 typos; naddy@unix-ag.uni-kl.de (diff) | |
download | wireguard-openbsd-e960b9a34d0d5955da33f84221ded84db9a1db6a.tar.xz wireguard-openbsd-e960b9a34d0d5955da33f84221ded84db9a1db6a.zip |
Correct casts in nfs_statfs() V3 code to correspond to reality (ie:
struct statfs). Also, Make sure we do signed arithmatic when computing
f_bavail.
-rw-r--r-- | sys/nfs/nfs_vfsops.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/nfs/nfs_vfsops.c b/sys/nfs/nfs_vfsops.c index 964c1eba7dd..647edc30f12 100644 --- a/sys/nfs/nfs_vfsops.c +++ b/sys/nfs/nfs_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_vfsops.c,v 1.27 1999/06/10 05:55:16 millert Exp $ */ +/* $OpenBSD: nfs_vfsops.c,v 1.28 2000/01/01 23:50:59 millert Exp $ */ /* $NetBSD: nfs_vfsops.c,v 1.46.4.1 1996/05/25 22:40:35 fvdl Exp $ */ /* @@ -149,11 +149,11 @@ nfs_statfs(mp, sbp, p) if (v3) { sbp->f_bsize = NFS_FABLKSIZE; tquad = fxdr_hyper(&sfp->sf_tbytes); - sbp->f_blocks = (long)(tquad / ((u_quad_t)NFS_FABLKSIZE)); + sbp->f_blocks = (u_int32_t)(tquad / (u_quad_t)NFS_FABLKSIZE); tquad = fxdr_hyper(&sfp->sf_fbytes); - sbp->f_bfree = (long)(tquad / ((u_quad_t)NFS_FABLKSIZE)); + sbp->f_bfree = (u_int32_t)(tquad / (u_quad_t)NFS_FABLKSIZE); tquad = fxdr_hyper(&sfp->sf_abytes); - sbp->f_bavail = (long)(tquad / ((u_quad_t)NFS_FABLKSIZE)); + sbp->f_bavail = (int32_t)((quad_t)tquad / (quad_t)NFS_FABLKSIZE); sbp->f_files = (fxdr_unsigned(int32_t, sfp->sf_tfiles.nfsuquad[1]) & 0x7fffffff); sbp->f_ffree = (fxdr_unsigned(int32_t, |