bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Bruno Haible <bruno@clisp.org>
To: bug-gnulib@gnu.org
Cc: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Subject: Re: [PATCH] lib/pthread-cond.c: use tv.nsec instead of tv.usec
Date: Mon, 05 Apr 2021 12:46:44 +0200	[thread overview]
Message-ID: <10507677.tSNLp1E0dV@omega> (raw)
In-Reply-To: <20210405090458.3529164-1-fontaine.fabrice@gmail.com>

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	other threads:[~2021-04-05 12:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-05  9:04 [PATCH] lib/pthread-cond.c: use tv.nsec instead of tv.usec Fabrice Fontaine
2021-04-05 10:46 ` Bruno Haible [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=10507677.tSNLp1E0dV@omega \
    --to=bruno@clisp.org \
    --cc=bug-gnulib@gnu.org \
    --cc=fontaine.fabrice@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).