This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v2 04/11] Use clock_settime to implement settimeofday.



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.

Attachment: signature.asc
Description: OpenPGP digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]