mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-28 00:21:52 +03:00
linux: Allow adjtime with NULL argument [BZ #26833]
The adjtime interface allows return the amount of time remaining
from any previous adjustment that has not yet been completed by
passing a NULL as first argument. This was introduced with y2038
support 0308077e3a
.
Checked on i686-linux-gnu.
Reviewed-by: Lukasz Majewski <lukma@denx.de>
This commit is contained in:
@ -68,11 +68,16 @@ libc_hidden_def (__adjtime64)
|
||||
int
|
||||
__adjtime (const struct timeval *itv, struct timeval *otv)
|
||||
{
|
||||
struct __timeval64 itv64, otv64;
|
||||
struct __timeval64 itv64, *pitv64 = NULL;
|
||||
struct __timeval64 otv64;
|
||||
int retval;
|
||||
|
||||
itv64 = valid_timeval_to_timeval64 (*itv);
|
||||
retval = __adjtime64 (&itv64, otv != NULL ? &otv64 : NULL);
|
||||
if (itv != NULL)
|
||||
{
|
||||
itv64 = valid_timeval_to_timeval64 (*itv);
|
||||
pitv64 = &itv64;
|
||||
}
|
||||
retval = __adjtime64 (pitv64, otv != NULL ? &otv64 : NULL);
|
||||
if (otv != NULL)
|
||||
*otv = valid_timeval64_to_timeval (otv64);
|
||||
|
||||
|
Reference in New Issue
Block a user