Source-Changes-HG archive

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

[src/trunk]: src/bin/test test(1): Compare timestamp in nsec scale in -nt/-ot.



details:   https://anonhg.NetBSD.org/src/rev/a55a81d3cc4c
branches:  trunk
changeset: 786628:a55a81d3cc4c
user:      uebayasi <uebayasi%NetBSD.org@localhost>
date:      Sat May 04 06:26:44 2013 +0000

description:
test(1): Compare timestamp in nsec scale in -nt/-ot.

diffstat:

 bin/test/test.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r d2f35251666c -r a55a81d3cc4c bin/test/test.c
--- a/bin/test/test.c   Sat May 04 00:37:47 2013 +0000
+++ b/bin/test/test.c   Sat May 04 06:26:44 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: test.c,v 1.39 2012/03/15 02:02:21 joerg Exp $ */
+/* $NetBSD: test.c,v 1.40 2013/05/04 06:26:44 uebayasi Exp $ */
 
 /*
  * test(1); version 7-like  --  author Erik Baalbergen
@@ -12,7 +12,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: test.c,v 1.39 2012/03/15 02:02:21 joerg Exp $");
+__RCSID("$NetBSD: test.c,v 1.40 2013/05/04 06:26:44 uebayasi Exp $");
 #endif
 
 #include <sys/stat.h>
@@ -694,7 +694,7 @@
 
        return (stat(f1, &b1) == 0 &&
                stat(f2, &b2) == 0 &&
-               b1.st_mtime > b2.st_mtime);
+               timespeccmp(&b1.st_mtim, &b2.st_mtim, >));
 }
 
 static int
@@ -704,7 +704,7 @@
 
        return (stat(f1, &b1) == 0 &&
                stat(f2, &b2) == 0 &&
-               b1.st_mtime < b2.st_mtime);
+               timespeccmp(&b1.st_mtim, &b2.st_mtim, <));
 }
 
 static int



Home | Main Index | Thread Index | Old Index