From owner-freebsd-current@FreeBSD.ORG Fri Jan 30 10:10:15 2009 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CBF651065672; Fri, 30 Jan 2009 10:10:15 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id 7FE2D8FC16; Fri, 30 Jan 2009 10:10:15 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (critter.freebsd.dk [192.168.61.3]) by phk.freebsd.dk (Postfix) with ESMTP id 6BE923F129; Fri, 30 Jan 2009 10:10:14 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.14.3/8.14.3) with ESMTP id n0UAAEkn030969; Fri, 30 Jan 2009 10:10:14 GMT (envelope-from phk@critter.freebsd.dk) To: Tim Kientzle From: "Poul-Henning Kamp" In-Reply-To: Your message of "Thu, 29 Jan 2009 22:25:13 PST." <49829D49.10306@freebsd.org> Date: Fri, 30 Jan 2009 10:10:14 +0000 Message-ID: <30968.1233310214@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: "'current@FreeBSD.org'" Subject: Re: RFC: Change mtree nsec handling? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Jan 2009 10:10:16 -0000 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.