Re: Greater resolution in test -nt / test -ot

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

 



On Thu, Jun 22, 2017 at 10:30:02AM +0200, Petr Skočík wrote:
> Hi,
> 
> would you be willing to pull something like this?
> 
>  static int
> @@ -488,7 +490,9 @@ olderf (const char *f1, const char *f2)
> 
>  	return (stat (f1, &b1) == 0 &&
>  		stat (f2, &b2) == 0 &&
> -		b1.st_mtime < b2.st_mtime);
> +		(b1.st_mtim.tv_sec < b2.st_mtim.tv_sec ||
> +		 (b1.st_mtim.tv_sec == b2.st_mtim.tv_sec && (b1.st_mtim.tv_nsec <
> b2.st_mtim.tv_nsec )))
> +	);
>  }
> 
>  static int
> 
> I could use greater resolution in `test -nt` / `test -ot`, and st_mtim
> field is standardized under POSIX.1-2008 (or so stat(2) says).

Sure.  But your patch is corrupted.

Cheers,
-- 
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux