diff options
author | 1996-11-04 01:55:18 +0000 | |
---|---|---|
committer | 1996-11-04 01:55:18 +0000 | |
commit | e0ff438289a45b42fca6330c86c56e140a90c89a (patch) | |
tree | caf9904b96b844506d5bc4d7d33d587551c75e1c /sys | |
parent | Now allows for host name lengths longer than 100 characters; not (diff) | |
download | wireguard-openbsd-e0ff438289a45b42fca6330c86c56e140a90c89a.tar.xz wireguard-openbsd-e0ff438289a45b42fca6330c86c56e140a90c89a.zip |
Redo access time change; it should be updated on a read of 0 bytes when
more than 0 bytes were requested, but not when 0 bytes were requested
Diffstat (limited to 'sys')
-rw-r--r-- | sys/ufs/ufs/ufs_readwrite.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/ufs/ufs/ufs_readwrite.c b/sys/ufs/ufs/ufs_readwrite.c index b06c95fd92a..80238dbf26c 100644 --- a/sys/ufs/ufs/ufs_readwrite.c +++ b/sys/ufs/ufs/ufs_readwrite.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ufs_readwrite.c,v 1.7 1996/10/29 08:03:22 tholo Exp $ */ +/* $OpenBSD: ufs_readwrite.c,v 1.8 1996/11/04 01:55:18 tholo Exp $ */ /* $NetBSD: ufs_readwrite.c,v 1.9 1996/05/11 18:27:57 mycroft Exp $ */ /*- @@ -96,7 +96,7 @@ READ(v) daddr_t lbn, nextlbn; off_t bytesinfile; long size, xfersize, blkoffset; - int error, anyread = 0; + int error; u_short mode; vp = ap->a_vp; @@ -120,6 +120,9 @@ READ(v) if ((u_int64_t)uio->uio_offset > MAXFILESIZE) return (EFBIG); + if (uio->uio_resid == 0) + return (0); + for (error = 0, bp = NULL; uio->uio_resid > 0; bp = NULL) { if ((bytesinfile = ip->i_size - uio->uio_offset) <= 0) break; @@ -170,7 +173,6 @@ READ(v) break; xfersize = size; } - anyread = 1; error = uiomove((char *)bp->b_data + blkoffset, (int)xfersize, uio); if (error) @@ -179,8 +181,7 @@ READ(v) } if (bp != NULL) brelse(bp); - if (anyread) - ip->i_flag |= IN_ACCESS; + ip->i_flag |= IN_ACCESS; return (error); } |