From: Todd C. Miller Date: Thu, 14 Jun 2007 11:09:49 +0000 (+0000) Subject: Since we need to be able to convert timespec to timeval for X-Git-Tag: SUDO_1_7_0~557 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1f38301a5d6a6f0d3ae51c7c31a0f31f4319faf1;p=sudo Since we need to be able to convert timespec to timeval for utimes() the last 3 digits in the tv_nsec are not significant. This makes the sudoedit file date comparison work again. --- diff --git a/configure.in b/configure.in index 036cb7d33..9918bb758 100644 --- a/configure.in +++ b/configure.in @@ -2377,14 +2377,16 @@ AH_TOP([#ifndef _SUDO_CONFIG_H AH_BOTTOM([/* * Macros to pull sec and nsec parts of mtime from struct stat. + * We need to be able to convert between timeval and timespec + * so the last 3 digits of tv_nsec are not significant. */ #ifdef HAVE_ST_MTIM # define mtim_getsec(_x) ((_x).st_mtim.tv_sec) -# define mtim_getnsec(_x) ((_x).st_mtim.tv_nsec) +# define mtim_getnsec(_x) (((_x).st_mtim.tv_nsec / 1000) * 1000) #else # ifdef HAVE_ST_MTIMESPEC # define mtim_getsec(_x) ((_x).st_mtimespec.tv_sec) -# define mtim_getnsec(_x) ((_x).st_mtimespec.tv_nsec) +# define mtim_getnsec(_x) (((_x).st_mtimespec.tv_nsec / 1000) * 1000) # else # define mtim_getsec(_x) ((_x).st_mtime) # define mtim_getnsec(_x) (0)