mirror of
https://github.com/samba-team/samba.git
synced 2025-02-02 09:47:23 +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:
parent
b5e56a30df
commit
920611f0bc
@ -323,7 +323,7 @@ void create_clock_itime(struct stat_ex *dst)
|
|||||||
uint8_t rval;
|
uint8_t rval;
|
||||||
|
|
||||||
/* Start with the system clock. */
|
/* Start with the system clock. */
|
||||||
clock_gettime_mono(&itime);
|
itime = timespec_current();
|
||||||
|
|
||||||
/* Convert to NTTIME. */
|
/* Convert to NTTIME. */
|
||||||
tval = unix_timespec_to_nt_time(itime);
|
tval = unix_timespec_to_nt_time(itime);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user