Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Aug 2008 10:18:30 +0200
From:      =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@des.no>
To:        Ruslan Ermilov <ru@freebsd.org>
Cc:        FreeBSD Tinderbox <tinderbox@freebsd.org>, current@freebsd.org
Subject:   Re: [head tinderbox] failure on amd64/amd64
Message-ID:  <86tzdgje09.fsf@ds4.des.no>
In-Reply-To: <20080819171105.GB19836@edoofus.dev.vega.ru> (Ruslan Ermilov's message of "Tue, 19 Aug 2008 21:11:05 %2B0400")
References:  <20080813185600.B88E373039@freebsd-current.sentex.ca> <86abfgs5v6.fsf@ds4.des.no> <20080819171105.GB19836@edoofus.dev.vega.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
Ruslan Ermilov <ru@freebsd.org> writes:
> "-mtime -0" interacts badly with the TIME_CORRECT() macro when mtime
> and run-time happen to be the same second.  While I think it's a bug
> in the find(1) code that needs to be fixed, using "-mtime -0s" seems
> to avoid the macro and thus works as expected.

% date ; touch foo ; find foo -mtime 0s ; date ; sleep 1 ; find foo -mtime =
0s ; date
Wed Aug 20 10:09:11 CEST 2008
foo
Wed Aug 20 10:09:11 CEST 2008
Wed Aug 20 10:09:12 CEST 2008
% date ; touch foo ; find foo -mtime 0s ; date ; sleep 1 ; find foo -mtime =
1s ; date
Wed Aug 20 10:11:23 CEST 2008
foo
Wed Aug 20 10:11:23 CEST 2008
foo
Wed Aug 20 10:11:24 CEST 2008

'-mtime Ns' evaluates to true if the difference between current time and
the file's mtime is *exactly* N seconds.

'-mtime N' evaluates to true if the difference between current time and
the file's mtime is between N-1 and N days.

As written, the test will fail if sys/sys/param.h's mtime is between now
and 86399 seconds into the future, and succeed otherwise.  If we change
0 to 0s, it will fail if sys/sys/param.h's mtime is exactly the current
time, and succeed otherwise.

Personally, I think the test is useless, as there are a million other
ways to mess up your build, but if you absolutely must have it there,
the correct predicate would be '-newermt now'.

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86tzdgje09.fsf>