bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
To: bug-gnulib@gnu.org
Cc: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Subject: [PATCH] lib/pthread-cond.c: use tv.nsec instead of tv.usec
Date: Mon,  5 Apr 2021 11:04:58 +0200	[thread overview]
Message-ID: <20210405090458.3529164-1-fontaine.fabrice@gmail.com> (raw)

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);
     }
 }
-- 
2.30.2



             reply	other threads:[~2021-04-05  9:05 UTC|newest]

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

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=20210405090458.3529164-1-fontaine.fabrice@gmail.com \
    --to=fontaine.fabrice@gmail.com \
    --cc=bug-gnulib@gnu.org \
    /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).