Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/mtree fix thinko in mtime stuff.



details:   https://anonhg.NetBSD.org/src/rev/d460eec9e240
branches:  trunk
changeset: 474534:d460eec9e240
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Jul 10 19:59:28 1999 +0000

description:
fix thinko in mtime stuff.

diffstat:

 usr.sbin/mtree/compare.c |  15 ++++++---------
 1 files changed, 6 insertions(+), 9 deletions(-)

diffs (45 lines):

diff -r 0faa01fced07 -r d460eec9e240 usr.sbin/mtree/compare.c
--- a/usr.sbin/mtree/compare.c  Sat Jul 10 19:46:10 1999 +0000
+++ b/usr.sbin/mtree/compare.c  Sat Jul 10 19:59:28 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compare.c,v 1.21 1999/07/06 15:11:14 christos Exp $    */
+/*     $NetBSD: compare.c,v 1.22 1999/07/10 19:59:28 christos Exp $    */
 
 /*-
  * Copyright (c) 1989, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)compare.c  8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: compare.c,v 1.21 1999/07/06 15:11:14 christos Exp $");
+__RCSID("$NetBSD: compare.c,v 1.22 1999/07/10 19:59:28 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -243,22 +243,19 @@
        if (s->flags & F_TIME) {
                struct timeval tv[2];
                struct stat *ps = p->fts_statp;
+               time_t smtime = s->st_mtimespec.tv_sec;
+
 #ifdef BSD4_4
-               time_t smtime = s->st_mtimespec.tv_sec;
                time_t pmtime = ps->st_mtimespec.tv_sec;
 
-               TIMESPEC_TO_TIMEVAL(&tv[0], &s->st_mtimespec);
                TIMESPEC_TO_TIMEVAL(&tv[1], &ps->st_mtimespec);
 #else
-               time_t smtime = s->st_mtime;
-               time_t pmtime = ps->st_mtime;
+               time_t pmtime = (time_t)ps->st_mtime;
 
-               tv[0].tv_sec = s->st_mtime;
-               tv[0].tv_usec = 0;
                tv[1].tv_sec = ps->st_mtime;
                tv[1].tv_usec = 0;
 #endif
-
+               TIMESPEC_TO_TIMEVAL(&tv[0], &s->st_mtimespec);
 
                if (tv[0].tv_sec != tv[1].tv_sec ||
                    tv[0].tv_usec != tv[1].tv_usec) {



Home | Main Index | Thread Index | Old Index