Subject: bin/1660: mtree compare fails (typo)
To: None <gnats-bugs@gnats.netbsd.org>
From: Arne Henrik Juul <arnej@imf.unit.no>
List: netbsd-bugs
Date: 10/20/1995 18:21:38
>Number:         1660
>Category:       bin
>Synopsis:       mtree compare fails (typo)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Oct 20 12:35:01 1995
>Last-Modified:
>Originator:     Arne H. Juul
>Organization:
	
>Release:        NetBSD-current 18 Oct 1995
>Environment:
	
System: NetBSD leon.imf.unit.no 1.1_ALPHA NetBSD 1.1_ALPHA (LEON) #0: Fri Oct 20 14:44:48 MET 1995 arnej@leon.imf.unit.no:/usr/src/sys/arch/i386/compile/LEON i386

>Description:
	Mtree complains that modification times should be 1 Jan 1970
on directories.  This only happens when I NFS-mount directories
from some other machine, probably because of differences in handling
fractional seconds.  But, mtree shouldn't be comparing those fractional
seconds in the first place.
	This is somewhat confusing when building snapshots, since
I then NFS-mount the complete hierarchy and mtree complains on every
single directory.

>How-To-Repeat:
	NFS-mount /usr/obj, install latest mtree, then:
	# cd /usr/src/etc
	# make DESTDIR=/ distrib-dirs
	After which I get:
usr/obj: 
        modification time (Thu Jan  1 01:00:00 1970, Wed Oct 18 21:33:30 1995)
usr/obj/lib: 
        modification time (Thu Jan  1 01:00:00 1970, Wed Oct 18 21:20:23 1995)
usr/obj/bin: 
        modification time (Thu Jan  1 01:00:00 1970, Wed Oct 18 21:21:00 1995)
usr/obj/libexec: 
        modification time (Thu Jan  1 01:00:00 1970, Wed Oct 18 21:21:29 1995)

>Fix:
	Apply this patch:
--- compare.c.orig	Fri Oct 20 17:06:02 1995
+++ compare.c	Fri Oct 20 17:06:28 1995
@@ -176,8 +176,8 @@
 	 * Catches nano-second differences, but doesn't display them.
 	 */
 	if (s->flags & F_TIME &&
-	    s->st_mtimespec.ts_sec != p->fts_statp->st_mtimespec.ts_sec ||
-	    s->st_mtimespec.ts_nsec != p->fts_statp->st_mtimespec.ts_nsec) {
+	    (s->st_mtimespec.ts_sec != p->fts_statp->st_mtimespec.ts_sec ||
+	     s->st_mtimespec.ts_nsec != p->fts_statp->st_mtimespec.ts_nsec)) {
 		LABEL;
 		(void)printf("%smodification time (%.24s, ",
 		    tab, ctime(&s->st_mtimespec.ts_sec));
>Audit-Trail:
>Unformatted: