diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2003-11-15 21:09:40 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2003-11-15 21:09:40 +0000 |
commit | 4efec134906c92a6b4ea640979f2ee65f790deaf (patch) | |
tree | a00f6df07cd7f8a903f0bac282d52abe1816d930 /sys/miscfs/kernfs | |
parent | 64b9fc343e09e4f73310f4cced8d091180950a44 (diff) |
set boottime's time to boottime, handy for find. requested by markus.
don't bother with microtime. time should be more than enough precision.
from netbsd.
Diffstat (limited to 'sys/miscfs/kernfs')
-rw-r--r-- | sys/miscfs/kernfs/kernfs_vnops.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/miscfs/kernfs/kernfs_vnops.c b/sys/miscfs/kernfs/kernfs_vnops.c index c6b834fd24e..11066205508 100644 --- a/sys/miscfs/kernfs/kernfs_vnops.c +++ b/sys/miscfs/kernfs/kernfs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kernfs_vnops.c,v 1.35 2003/09/23 16:51:13 millert Exp $ */ +/* $OpenBSD: kernfs_vnops.c,v 1.36 2003/11/15 21:09:39 tedu Exp $ */ /* $NetBSD: kernfs_vnops.c,v 1.43 1996/03/16 23:52:47 christos Exp $ */ /* @@ -585,7 +585,6 @@ kernfs_getattr(v) } */ *ap = v; struct vnode *vp = ap->a_vp; struct vattr *vap = ap->a_vap; - struct timeval tv; int error = 0; char strbuf[KSTRING], *buf; @@ -597,8 +596,7 @@ kernfs_getattr(v) vap->va_fsid = vp->v_mount->mnt_stat.f_fsid.val[0]; vap->va_size = 0; vap->va_blocksize = DEV_BSIZE; - microtime(&tv); - TIMEVAL_TO_TIMESPEC(&tv, &vap->va_atime); + TIMEVAL_TO_TIMESPEC(&time, &vap->va_atime); vap->va_mtime = vap->va_atime; vap->va_ctime = vap->va_atime; vap->va_gen = 0; @@ -622,6 +620,12 @@ kernfs_getattr(v) #ifdef KERNFS_DIAGNOSTIC printf("kernfs_getattr: stat target %s\n", kt->kt_name); #endif + if (kt == &kern_targets[2]) { + /* set boottime times to boottime */ + TIMEVAL_TO_TIMESPEC(&boottime, &vap->va_atime); + vap->va_mtime = vap->va_atime; + vap->va_ctime = vap->va_atime; + } vap->va_type = kt->kt_vtype; vap->va_mode = kt->kt_mode; vap->va_nlink = 1; |