linux: fix ntp_gettime abi break (BZ# 30156)
commite78c4c49831d0ca6253ff5ce5b956cdc4189c8a9
authorKacper Piwiński <vfjpl1@gmail.com>
Thu, 9 Mar 2023 10:38:59 +0000 (9 11:38 +0100)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Fri, 10 Mar 2023 18:07:55 +0000 (10 15:07 -0300)
tree56f9cbab0714fa1c74e525a53a78d19f32942599
parentf7e751affbedf67e16ef97e9da430bd67d793891
linux: fix ntp_gettime abi break (BZ# 30156)

Between versions v2.11 and v2.12 struct ntptimeval got new fields.
That wasn't a problem because new function ntp_gettimex was created
(and made default) to support new struct.  Old ntp_gettime was not
using new fields so it was safe to call with old struct
definition.  Then commits 5613afe9e3dff and b6ad64b907a (added for
64 bit time_t support), ntp_gettime start setting new fields.

Sets fields manually to maintain compatibility with v2.11 struct
definition.

Resolves #30156

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
sysdeps/unix/sysv/linux/ntp_gettime.c