bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] lib/pthread-cond.c: use tv.nsec instead of tv.usec


From: Bruno Haible
Subject: Re: [PATCH] lib/pthread-cond.c: use tv.nsec instead of tv.usec
Date: Mon, 05 Apr 2021 12:46:44 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-206-generic; KDE/5.18.0; x86_64; ; )

Fabrice Fontaine wrote:
> Use tv.nsec instead of tv.usec to avoid the following build failure:
> 
> lib/pthread-cond.c: In function 'pthread_cond_wait':
> lib/pthread-cond.c:121:16: error: 'struct timespec' has no member named 
> 'tv_usec'; did you mean 'tv_sec'?
>   121 |       duration.tv_usec = 0;
>       |                ^~~~~~~
>       |                tv_sec
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
>  lib/pthread-cond.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/pthread-cond.c b/lib/pthread-cond.c
> index baa7c60bb..c2c00be03 100644
> --- a/lib/pthread-cond.c
> +++ b/lib/pthread-cond.c
> @@ -118,7 +118,7 @@ pthread_cond_wait (pthread_cond_t *cond _GL_UNUSED,
>        struct timespec duration;
>  
>        duration.tv_sec = 86400;
> -      duration.tv_usec = 0;
> +      duration.tv_nsec = 0;
>        nanosleep (&duration, NULL);
>      }
>  }
> 

Oops. Thank you for the report and fix. Applied with this ChangeLog entry:


2021-04-05  Fabrice Fontaine  <fontaine.fabrice@gmail.com>

        pthread-cond: Fix compilation error.
        * lib/pthread-cond.c (pthread_cond_wait): Use tv.nsec instead of
        tv.usec.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]