summaryrefslogtreecommitdiffstats
path: root/usr.sbin/mtree
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/mtree')
-rw-r--r--usr.sbin/mtree/create.c2
-rw-r--r--usr.sbin/mtree/mtree.54
-rw-r--r--usr.sbin/mtree/mtree.84
-rw-r--r--usr.sbin/mtree/spec.c2
4 files changed, 9 insertions, 3 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)) {
diff --git a/usr.sbin/mtree/mtree.5 b/usr.sbin/mtree/mtree.5
index db54943..375cc78 100644
--- a/usr.sbin/mtree/mtree.5
+++ b/usr.sbin/mtree/mtree.5
@@ -200,7 +200,9 @@ The size, in bytes, of the file.
.It Cm link
The file the symbolic link is expected to reference.
.It Cm time
-The last modification time of the file.
+The last modification time of the file, in seconds and nanoseconds.
+The value should include a period character and exactly nine digits
+after the period.
.It Cm type
The type of the file; may be set to any one of the following:
.Pp
diff --git a/usr.sbin/mtree/mtree.8 b/usr.sbin/mtree/mtree.8
index 439eaab..f0a93ed 100644
--- a/usr.sbin/mtree/mtree.8
+++ b/usr.sbin/mtree/mtree.8
@@ -233,7 +233,9 @@ The size, in bytes, of the file.
.It Cm link
The file the symbolic link is expected to reference.
.It Cm time
-The last modification time of the file.
+The last modification time of the file, in seconds and nanoseconds.
+The value should include a period character and exactly nine digits
+after the period.
.It Cm type
The type of the file; may be set to any one of the following:
.Pp
diff --git a/usr.sbin/mtree/spec.c b/usr.sbin/mtree/spec.c
index f2e7647..c7c6460 100644
--- a/usr.sbin/mtree/spec.c
+++ b/usr.sbin/mtree/spec.c
@@ -255,6 +255,8 @@ set(char *t, NODE *ip)
case F_TIME:
ip->st_mtimespec.tv_sec = strtoul(val, &ep, 10);
if (*ep == '.') {
+ /* Note: we require exactly nine
+ * digits after the decimal point. */
val = ep + 1;
ip->st_mtimespec.tv_nsec
= strtoul(val, &ep, 10);
OpenPOWER on IntegriCloud