Date: Fri, 30 Jan 2009 10:10:14 +0000 From: "Poul-Henning Kamp" <phk@phk.freebsd.dk> To: Tim Kientzle <kientzle@freebsd.org> Cc: "'current@FreeBSD.org'" <current@freebsd.org> Subject: Re: RFC: Change mtree nsec handling? Message-ID: <30968.1233310214@critter.freebsd.dk> In-Reply-To: Your message of "Thu, 29 Jan 2009 22:25:13 PST." <49829D49.10306@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
In message <49829D49.10306@freebsd.org>, Tim Kientzle writes: >mtree support and the mtree(8) program, I found >that mtree formats timestamps rather strangely. > >For example, a timestamp of 1233295862.000001 >(1233295682 seconds and 1000 nanoseconds) >will be printed like this by mtree: > time=1233295862.1000 >Unsurprisingly, the mtree parsing works the same >way in reverse. >Index: spec.c >=================================================================== >--- spec.c (revision 187910) >+++ spec.c (working copy) >@@ -172,6 +172,7 @@ > mode_t *m; > int value; > char *ep; >+ int i; > > for (; (kw = strtok(t, "= \t\n")); t = NULL) { > ip->flags |= type = parsekey(kw, &value); >@@ -258,6 +259,8 @@ > val = ep + 1; > ip->st_mtimespec.tv_nsec > = strtoul(val, &ep, 10); >+ for (i = ep - val; i < 9; ++i) >+ ip->st_mtimespec.tv_nsec *= 10; Why is this bit needed ? -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?30968.1233310214>