aboutsummaryrefslogtreecommitdiff
path: root/sys/msdosfs
diff options
context:
space:
mode:
authorPaul Traina <pst@FreeBSD.org>1994-10-27 18:44:31 +0000
committerPaul Traina <pst@FreeBSD.org>1994-10-27 18:44:31 +0000
commit6213f6fc8f71846d2771ec1e0795b53866e48afd (patch)
tree4f3d39c93a4db8ce82aea1977ee80fb21bcecf48 /sys/msdosfs
parentab1a62c2a262a99d6fd1dcc1f1e6dd729e229a66 (diff)
downloadsrc-6213f6fc8f71846d2771ec1e0795b53866e48afd.tar.gz
src-6213f6fc8f71846d2771ec1e0795b53866e48afd.zip
Set the EOF flag properly.
Obtained from: netbsd-bugs mailing list
Notes
Notes: svn path=/head/; revision=3935
Diffstat (limited to 'sys/msdosfs')
-rw-r--r--sys/msdosfs/msdosfs_vnops.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/msdosfs/msdosfs_vnops.c b/sys/msdosfs/msdosfs_vnops.c
index 7773f5981541..433c92552732 100644
--- a/sys/msdosfs/msdosfs_vnops.c
+++ b/sys/msdosfs/msdosfs_vnops.c
@@ -1,4 +1,4 @@
-/* $Id: msdosfs_vnops.c,v 1.5 1994/10/06 21:06:53 davidg Exp $ */
+/* $Id: msdosfs_vnops.c,v 1.6 1994/10/23 00:41:17 martin Exp $ */
/* $NetBSD: msdosfs_vnops.c,v 1.20 1994/08/21 18:44:13 ws Exp $ */
/*-
@@ -1532,8 +1532,10 @@ msdosfs_readdir(ap)
on = (uio->uio_offset - bias) & pmp->pm_crbomask;
n = min((u_long) (pmp->pm_bpcluster - on), uio->uio_resid);
diff = dep->de_FileSize - (uio->uio_offset - bias);
- if (diff <= 0)
+ if (diff <= 0) {
+ *ap->a_eofflag = 1;
return 0;
+ }
if (diff < n)
n = diff;
error = pcbmap(dep, lbn, &bn, &cn);
@@ -1685,12 +1687,10 @@ out: ;
}
/*
- * I don't know why we bother setting this eofflag, getdirentries()
- * in vfs_syscalls.c doesn't bother to look at it when we return.
- * (because NFS uses it in nfs_serv.c -- JMP)
+ * Set the eofflag (NFS uses it)
*/
if (ap->a_eofflag)
- if (dep->de_FileSize - uio->uio_offset - bias <= 0)
+ if (dep->de_FileSize - (uio->uio_offset - bias) <= 0)
*ap->a_eofflag = 1;
else
*ap->a_eofflag = 0;