basic/stat-util: make mtime check stricter and use entire timestamp
authorMichal Sekletár <msekleta@redhat.com>
Thu, 5 Nov 2020 16:55:25 +0000 (17:55 +0100)
committerThe Plumber <50238977+systemd-rhel-bot@users.noreply.github.com>
Mon, 25 Jan 2021 14:05:18 +0000 (15:05 +0100)
commit29c5b8dd6228c4401f034ca0aa85f99ac42cf8dd
tree6d5629c6122878ec0632ecc4edfc35c7823d8973
parentfb58a56c6c1c2749ba634abd9ad76f4e718269a1
basic/stat-util: make mtime check stricter and use entire timestamp

Note that st_mtime member of struct stat is defined as follows,

 #define st_mtime st_mtim.tv_sec

Hence we omitted checking nanosecond part of the timestamp (struct
timespec) and possibly would miss modifications that happened within the
same second.

(cherry picked from commit a59b0a9f768f6e27b25f4f1bab6de08842e78d74)

Related: #1642728
src/basic/stat-util.c
src/basic/stat-util.h