diff options
author | Colin Watson <cjwatson@debian.org> | 2014-09-09 12:24:37 +0100 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2014-09-11 12:53:28 +0100 |
commit | 8cabdfbf42bdb94bdc500ae4463d0e498349946f (patch) | |
tree | 1a5153560a87ceecfde9048d862c185a63efe267 /lib/util.c | |
parent | d9ebedad152816ea2ee8725a0ee1b0f80f7aeb46 (diff) |
Use high-precision timestamps for manual pages
* lib/util.c (is_changed): Compare high-precision timestamps.
* libdb/db_storage.h (FIELDS): Increment to 10.
(struct mandata): Change "time_t _st_mtime" to "struct timespec
mtime".
* libdb/db_lookup.c (dbprintf): Update mtime display.
(split_content): Store two fields for the mtime (seconds and
nanoseconds).
(make_content): Expect two fields for the mtime.
* libdb/db_store.c (replace_if_necessary): Compare high-precision
timestamps.
* src/check_mandirs.c (test_manfile): Likewise.
* src/man.c (maybe_update_file): Likewise.
* src/straycats.c (check_for_stray): Update initialisation of struct
mandata.
* src/tests/testlib.sh (accessdb_filter): Adjust for new format.
* manual/db.me (Contents of an index database): Describe new format.
(Example database): Update example output.
* NEWS: Document this.
Diffstat (limited to 'lib/util.c')
-rw-r--r-- | lib/util.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -44,6 +44,8 @@ #include <unistd.h> #include <locale.h> +#include "stat-time.h" +#include "timespec.h" #include "xvasprintf.h" #include "gettext.h" @@ -97,7 +99,8 @@ int is_changed (const char *fa, const char *fb) if (fb_sb.st_size == 0) status |= 4; - status |= (fa_sb.st_mtime != fb_sb.st_mtime); + status |= (timespec_cmp (get_stat_mtime (&fa_sb), + get_stat_mtime (&fb_sb)) != 0); debug (" (%d)\n", status); return status; |