[PATCH v2 04/11] Use clock_settime to implement settimeofday.
Adhemerval Zanella
adhemerval.zanella@linaro.org
Mon Oct 28 18:28:00 GMT 2019
On 25/10/2019 12:28, Lukasz Majewski wrote:
> On Fri, 25 Oct 2019 09:08:25 -0300
> Adhemerval Zanella <adhemerval.zanella@linaro.org> wrote:
>
>> From: Zack Weinberg <zackw@panix.com>
>>
[...]
>> fb2a36df19..914f5ac57b 100644 ---
>> a/sysdeps/unix/sysv/linux/alpha/osf_settimeofday.c +++
>> b/sysdeps/unix/sysv/linux/alpha/osf_settimeofday.c @@ -32,9 +32,19 @@
>> attribute_compat_text_section __settimeofday_tv32 (const struct
>> timeval32 *tv32, const struct timezone *tz) {
>> - struct timeval tv;
>> - tv32_to_tv64 (&tv, tv32);
>> - return __settimeofday (&tv, tz);
>> + if (__glibc_unlikely (tz != 0))
>> + {
>> + if (tv32 != 0)
>> + {
>> + __set_errno (EINVAL);
>> + return -1;
>> + }
>> + return __settimezone (tz);
>> + }
>> +
>> + struct timespec ts;
>> + tv32_to_ts64 (&ts, tv32);
>
> This can be replaced with valid_timeval_to_timespec64() from
> include/time.h
Not really, the timeval32 is alpha-specific.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20191028/8620e6d1/attachment.sig>
More information about the Libc-alpha
mailing list