diff mbox series

Linux: Add missing handling of tai field to __ntp_gettime64

Message ID 87tv0aaago.fsf@oldenburg2.str.redhat.com
State Committed
Headers show
Series Linux: Add missing handling of tai field to __ntp_gettime64 | expand

Commit Message

Florian Weimer May 20, 2020, 3:32 p.m. UTC
This fixes a build error:

../sysdeps/unix/sysv/linux/ntp_gettime.c: In function ‘__ntp_gettime’:
../sysdeps/unix/sysv/linux/ntp_gettime.c:56:10: error: ‘ntv64.tai’ is used uninitialized in this function [-Werror=uninitialized]
   56 |   *ntv = valid_ntptimeval64_to_ntptimeval (ntv64);
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---
Testing on x86_64-linux-gnu, i686-linux-gnu and building with
build-many-glibcs.py is under way.

 sysdeps/unix/sysv/linux/ntp_gettime.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Joseph Myers May 20, 2020, 3:53 p.m. UTC | #1
On Wed, 20 May 2020, Florian Weimer via Libc-alpha wrote:

> This fixes a build error:
> 
> ../sysdeps/unix/sysv/linux/ntp_gettime.c: In function ‘__ntp_gettime’:
> ../sysdeps/unix/sysv/linux/ntp_gettime.c:56:10: error: ‘ntv64.tai’ is used uninitialized in this function [-Werror=uninitialized]
>    56 |   *ntv = valid_ntptimeval64_to_ntptimeval (ntv64);
>       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> ---
> Testing on x86_64-linux-gnu, i686-linux-gnu and building with
> build-many-glibcs.py is under way.

OK.
Florian Weimer May 20, 2020, 3:59 p.m. UTC | #2
* Joseph Myers:

> On Wed, 20 May 2020, Florian Weimer via Libc-alpha wrote:
>
>> This fixes a build error:
>> 
>> ../sysdeps/unix/sysv/linux/ntp_gettime.c: In function ‘__ntp_gettime’:
>> ../sysdeps/unix/sysv/linux/ntp_gettime.c:56:10: error: ‘ntv64.tai’ is used uninitialized in this function [-Werror=uninitialized]
>>    56 |   *ntv = valid_ntptimeval64_to_ntptimeval (ntv64);
>>       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> 
>> ---
>> Testing on x86_64-linux-gnu, i686-linux-gnu and building with
>> build-many-glibcs.py is under way.
>
> OK.

Thanks, pushed after successful testing.

Florian
Lukasz Majewski May 20, 2020, 5:09 p.m. UTC | #3
Hi Florian,

> This fixes a build error:
> 
> ../sysdeps/unix/sysv/linux/ntp_gettime.c: In function ‘__ntp_gettime’:
> ../sysdeps/unix/sysv/linux/ntp_gettime.c:56:10: error: ‘ntv64.tai’ is
> used uninitialized in this function [-Werror=uninitialized] 56 |
> *ntv = valid_ntptimeval64_to_ntptimeval (ntv64); |
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> ---
> Testing on x86_64-linux-gnu, i686-linux-gnu and building with
> build-many-glibcs.py is under way.
> 
>  sysdeps/unix/sysv/linux/ntp_gettime.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/sysdeps/unix/sysv/linux/ntp_gettime.c
> b/sysdeps/unix/sysv/linux/ntp_gettime.c index 8ce5d13e00..2fdc6feb31
> 100644 --- a/sysdeps/unix/sysv/linux/ntp_gettime.c
> +++ b/sysdeps/unix/sysv/linux/ntp_gettime.c
> @@ -40,6 +40,7 @@ __ntp_gettime64 (struct __ntptimeval64 *ntv)
>    ntv->time = tntx.time;
>    ntv->maxerror = tntx.maxerror;
>    ntv->esterror = tntx.esterror;
> +  ntv->tai = tntx.tai;
>    return result;
>  }
>  
> 

Thanks for preparing the fix.


Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de
diff mbox series

Patch

diff --git a/sysdeps/unix/sysv/linux/ntp_gettime.c b/sysdeps/unix/sysv/linux/ntp_gettime.c
index 8ce5d13e00..2fdc6feb31 100644
--- a/sysdeps/unix/sysv/linux/ntp_gettime.c
+++ b/sysdeps/unix/sysv/linux/ntp_gettime.c
@@ -40,6 +40,7 @@  __ntp_gettime64 (struct __ntptimeval64 *ntv)
   ntv->time = tntx.time;
   ntv->maxerror = tntx.maxerror;
   ntv->esterror = tntx.esterror;
+  ntv->tai = tntx.tai;
   return result;
 }