[PATCH 5/5] y2038: Replace __clock_gettime with __clock_gettime64
Andreas Schwab
schwab@suse.de
Tue Mar 24 14:26:09 GMT 2020
On Mär 24 2020, Lukasz Majewski wrote:
> diff --git a/login/logout.c b/login/logout.c
> index 7653fe8886..a421d07301 100644
> --- a/login/logout.c
> +++ b/login/logout.c
> @@ -47,9 +47,13 @@ logout (const char *line)
> memset (ut->ut_name, '\0', sizeof ut->ut_name);
> memset (ut->ut_host, '\0', sizeof ut->ut_host);
>
> - struct timespec ts;
> - __clock_gettime (CLOCK_REALTIME, &ts);
> + struct __timespec64 ts;
> + __clock_gettime64 (CLOCK_REALTIME, &ts);
> +#if __WORDSIZE_TIME64_COMPAT32 || defined __s390x__ || defined __s390__
> TIMESPEC_TO_TIMEVAL (&ut->ut_tv, &ts);
> +#else
> + ut->ut_tv = valid_timespec64_to_timeval (ts);
> +#endif
Doesn't TIMESPEC_TO_TIMEVAL work generically?
Andreas.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
More information about the Libc-alpha
mailing list