diff options
author | maxim <maxim@FreeBSD.org> | 2006-12-03 19:04:26 +0000 |
---|---|---|
committer | maxim <maxim@FreeBSD.org> | 2006-12-03 19:04:26 +0000 |
commit | b3ab8f2011574fefd4ad8097c011e62a3edc5111 (patch) | |
tree | c3a64cd63051c6cca965810f8be9828aad5b1506 /sys/fs | |
parent | af51ff22340d96d114f2e3775d320add25977611 (diff) | |
download | FreeBSD-src-b3ab8f2011574fefd4ad8097c011e62a3edc5111.zip FreeBSD-src-b3ab8f2011574fefd4ad8097c011e62a3edc5111.tar.gz |
o Do not leave uninitialized birthtime: in MSDOSFSMNT_LONGNAME
set birthtime to FAT CTime (creation time) and in the other cases
set birthtime to -1.
o Set ctime to mtime instead of FAT CTime which has completely
different meaning.
PR: kern/106018
Submitted by: Oliver Fromme
MFC after: 1 month
Diffstat (limited to 'sys/fs')
-rw-r--r-- | sys/fs/msdosfs/msdosfs_vnops.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c index ae17f89..57b0ec8 100644 --- a/sys/fs/msdosfs/msdosfs_vnops.c +++ b/sys/fs/msdosfs/msdosfs_vnops.c @@ -343,13 +343,15 @@ msdosfs_getattr(ap) vap->va_rdev = 0; vap->va_size = dep->de_FileSize; fattime2timespec(dep->de_MDate, dep->de_MTime, 0, 0, &vap->va_mtime); + vap->va_ctime = vap->va_mtime; if (pmp->pm_flags & MSDOSFSMNT_LONGNAME) { fattime2timespec(dep->de_ADate, 0, 0, 0, &vap->va_atime); fattime2timespec(dep->de_CDate, dep->de_CTime, dep->de_CHun, - 0, &vap->va_ctime); + 0, &vap->va_birthtime); } else { vap->va_atime = vap->va_mtime; - vap->va_ctime = vap->va_mtime; + vap->va_birthtime.tv_sec = -1; + vap->va_birthtime.tv_nsec = 0; } vap->va_flags = 0; if ((dep->de_Attributes & ATTR_ARCHIVE) == 0) |