cvs commit: src/usr.sbin/mtree compare.c

Bruce Evans bde at zeta.org.au
Sat Nov 1 01:34:47 PST 2003


On Sat, 1 Nov 2003, Bruce Evans wrote:

> bde         2003/11/01 00:43:54 PST
>
>   FreeBSD src repository
>
>   Modified files:
>     usr.sbin/mtree       compare.c
>   Log:
>   Fixed breakage of my world in rev.1.30.  #include <sys/time.h> instead of
>   depending on namespace pollution in <sys/stat.h> for the declarations of
>   struct timeval and utimes().
>
>   Fixed some style bugs in rev.1.30 and some nearby style bugs (mainly
>   unsorting and missing or extra blank lines).
>
>   Removed a wrong comment that was obtained from NetBSD in rev.1.14.  It said
>   that chflags() reset the times that were set "above" by utimes(), but
>   utimes wasn't "above" in FreeBSD until rev.1.30, and chflags() does't
>   actually reset the times.
>
>   Revision  Changes    Path
>   1.31      +9 -13     src/usr.sbin/mtree/compare.c

This doesn't fix any of the more fundamental bugs in rev.1.30:
- setting modtimes cannot make the times match the spec in general, since
  we record and compare times in nanoseconds but can only set them in
  microseconds.
- the modtime setting should have been obained from NetBSD for
  compatibility and correctness.  NetBSD (a 2-3 month old version)
  only sets the modtimes if an the undocumented -t option is specified.
  It reduces the previous bug by only comparing times in microseconds
  (or seconds for the non-BSD_4_4 case).
- the access time is clobbered by setting it to the modtime.

NetBSD also has options to control setting of file flags.  Its -i (set
schg and/or sappnd) is very incompatible with FreeBSD's -i (indent 4
spaces).

Bruce


More information about the cvs-src mailing list