1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-24 02:04:21 +03:00

s3: lib: In create_clock_itime(), use timespec_current() -> clock_gettime(CLOCK_REALTIME..).

CLOCK_MONOTONIC (which we previously used) is reset
when the system is rebooted.

CLOCK_REALTIME is a "wall clock" time. It's still affected by NTP
changes (for Linux we should probably use CLOCK_TAI instead
but that is Linux-specific). For most systems CLOCK_REALTIME
will be good enough.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
Jeremy Allison 2022-01-10 09:01:09 -08:00
parent b5e56a30df
commit 920611f0bc

View File

@ -323,7 +323,7 @@ void create_clock_itime(struct stat_ex *dst)
uint8_t rval;
/* Start with the system clock. */
clock_gettime_mono(&itime);
itime = timespec_current();
/* Convert to NTTIME. */
tval = unix_timespec_to_nt_time(itime);