summaryrefslogtreecommitdiffstats
path: root/usr.sbin/mtree/create.c
diff options
context:
space:
mode:
authorkientzle <kientzle@FreeBSD.org>2009-01-31 05:17:28 +0000
committerkientzle <kientzle@FreeBSD.org>2009-01-31 05:17:28 +0000
commit1f959f94f16ab8a8d66723315c21d2fb48ac9096 (patch)
tree216d79a25cd8fa183c5a53ccda9cdf0366237b7e /usr.sbin/mtree/create.c
parentec7e619d54d66a50828c8bb429025c529f90e77d (diff)
downloadFreeBSD-src-1f959f94f16ab8a8d66723315c21d2fb48ac9096.zip
FreeBSD-src-1f959f94f16ab8a8d66723315c21d2fb48ac9096.tar.gz
Write timestamps with exactly 9 digits after the period.
This ensures that the value written is both compatible with older mtree versions (which expect the value after the period to be an integer count of nanoseconds after the whole second) and is a correct floating-point value. Leave the parsing code unchanged so it will continue to read older files.
Diffstat (limited to 'usr.sbin/mtree/create.c')
-rw-r--r--usr.sbin/mtree/create.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.sbin/mtree/create.c b/usr.sbin/mtree/create.c
index f1b0313..eee5037 100644
--- a/usr.sbin/mtree/create.c
+++ b/usr.sbin/mtree/create.c
@@ -212,7 +212,7 @@ statf(int indent, FTSENT *p)
output(indent, &offset, "size=%jd",
(intmax_t)p->fts_statp->st_size);
if (keys & F_TIME)
- output(indent, &offset, "time=%ld.%ld",
+ output(indent, &offset, "time=%ld.%09ld",
(long)p->fts_statp->st_mtimespec.tv_sec,
p->fts_statp->st_mtimespec.tv_nsec);
if (keys & F_CKSUM && S_ISREG(p->fts_statp->st_mode)) {
OpenPOWER on IntegriCloud