public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@linux-m68k.org>
To: Adhemerval Zanella via Libc-alpha <libc-alpha@sourceware.org>
Subject: Re: [PATCH v3 3/4] linux: Normalize and return timeout on select (BZ #27651)
Date: Mon, 12 Apr 2021 10:28:43 +0200	[thread overview]
Message-ID: <875z0r9a9w.fsf@igel.home> (raw)
In-Reply-To: <20210409155346.1357023-3-adhemerval.zanella@linaro.org> (Adhemerval Zanella via Libc-alpha's message of "Fri, 9 Apr 2021 12:53:45 -0300")

On Apr 09 2021, Adhemerval Zanella via Libc-alpha wrote:

> @@ -52,10 +74,13 @@ __select64 (int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
>           (though the pselect() glibc call suppresses this behavior).
>           Since select() on Linux has the same behavior as the pselect6
>           syscall, we update the timeout here.  */
> -      if (r == 0 || errno != ENOSYS)
> +      if (r >= 0 || errno != ENOSYS)
>  	{
>  	  if (timeout != NULL)
> -	    TIMEVAL_TO_TIMESPEC (timeout, &ts64);
> +	    {
> +	      timeout->tv_sec = ts64.tv_sec;
> +	      timeout->tv_usec = ts64.tv_nsec / NSEC_PER_USEC;
> +	    }

What's wrong with TIMESPEC_TO_TIMEVAL?

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

  reply	other threads:[~2021-04-12  8:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-09 15:53 [PATCH v3 1/4] libsupport: Add support_select_modifies_timeout Adhemerval Zanella
2021-04-09 15:53 ` [PATCH v3 2/4] libsupport: Add support_select_normalizes_timeout Adhemerval Zanella
2021-04-09 16:24   ` Florian Weimer
2021-04-09 15:53 ` [PATCH v3 3/4] linux: Normalize and return timeout on select (BZ #27651) Adhemerval Zanella
2021-04-12  8:28   ` Andreas Schwab [this message]
2021-04-12 12:20     ` Adhemerval Zanella
2021-04-12 18:26       ` Adhemerval Zanella
2021-04-12 19:20         ` Andreas Schwab
2021-04-09 15:53 ` [PATCH v3 4/4] linux: always update select timeout (BZ #27706) Adhemerval Zanella
2021-04-09 16:23 ` [PATCH v3 1/4] libsupport: Add support_select_modifies_timeout Florian Weimer

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

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

  git send-email \
    --in-reply-to=875z0r9a9w.fsf@igel.home \
    --to=schwab@linux-m68k.org \
    --cc=libc-alpha@sourceware.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).