In message <49829D49.10306_at_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) >_at__at_ -172,6 +172,7 _at__at_ > mode_t *m; > int value; > char *ep; >+ int i; > > for (; (kw = strtok(t, "= \t\n")); t = NULL) { > ip->flags |= type = parsekey(kw, &value); >_at__at_ -258,6 +259,8 _at__at_ > 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_at_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.Received on Fri Jan 30 2009 - 09:10:15 UTC
This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:41 UTC