1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
samba-mirror/lib/audit_logging/tests
Joseph Sutton 556b114f11 audit logging tests: Fix flapping test
On Linux, gettimeofday() uses the clock's microsecond field to adjust
the returned time in seconds, while time() only takes the seconds field
into account. As a result, time() would occasionally return a smaller
value than gettimeofday(), despite being called later.

Changing the time() calls to gettimeofday() as used in audit_logging.c
makes the time values consistent.

https://stackoverflow.com/questions/22917318/time-and-gettimeofday-return-different-seconds

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue May 11 07:03:35 UTC 2021 on sn-devel-184
2021-05-11 07:03:35 +00:00
..
audit_logging_error_test.c lib/audit_logging/test: fix typos 2021-04-12 20:07:47 +00:00
audit_logging_test.c audit logging tests: Fix flapping test 2021-05-11 07:03:35 +00:00