unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Sergey Bugaev via Libc-alpha <libc-alpha@sourceware.org>
To: bug-hurd@gnu.org, libc-alpha@sourceware.org, samuel.thibault@gnu.org
Subject: Re: [PATCH v3] hurd: Make getrandom cache the server port
Date: Fri, 2 Dec 2022 17:04:38 +0300	[thread overview]
Message-ID: <CAN9u=HfC0VTwpq_TZsNPmu=M1pXuc=Fg6sz7UP600baGSYV_pA@mail.gmail.com> (raw)
In-Reply-To: <20221202135558.23781-1-bugaevc@gmail.com>

On Fri, Dec 2, 2022 at 4:56 PM Sergey Bugaev <bugaevc@gmail.com> wrote:
> +  switch (flags)
> +    {
> +    case 0:
> +      cached_server = &urandom_server;
> +      break;
> +    case GRND_RANDOM:
> +      cached_server = &random_server;
> +      break;
> +    case GRND_NONBLOCK:
> +      cached_server = &urandom_server_nonblock;
> +      break;
> +    case GRND_RANDOM | GRND_NONBLOCK:
> +      cached_server = &random_server_nonblock;
> +      break;
> +    default:
> +      return __hurd_fail (EINVAL);
> +    }
> +
> +    if (flags & GRND_RANDOM)
> +      random_source = "/dev/random";
> +    if (flags & GRND_NONBLOCK)
> +      open_flags |= O_NONBLOCK;
> +    /* No point in passing either O_NOCTTY, O_IGNORE_CTTY, or O_CLOEXEC
> +       to file_name_lookup, since we're not making an fd.  */

Ooops, the indentation is off here, and of course I'm only seeing this
after having sent the patch. Nor did GCC warn me. Sigh.

If the patch is otherwise alright, could you please fix that when
committing? If it's not, I'll fix it in v4.

Sergey

  reply	other threads:[~2022-12-02 14:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20221130003150.4mnx6xd2g53rox7a@begin>
2022-12-02  9:13 ` [PATCH v2] hurd: Make getrandom cache the server port Sergey Bugaev via Libc-alpha
2022-12-02  9:17   ` Samuel Thibault via Libc-alpha
2022-12-02 13:18     ` Sergey Bugaev via Libc-alpha
2022-12-02 13:55       ` Samuel Thibault via Libc-alpha
2022-12-02 13:55       ` [PATCH v3] " Sergey Bugaev via Libc-alpha
2022-12-02 14:04         ` Sergey Bugaev via Libc-alpha [this message]
2022-12-02 22:46         ` Samuel Thibault via Libc-alpha

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://www.gnu.org/software/libc/involved.html

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

  git send-email \
    --in-reply-to='CAN9u=HfC0VTwpq_TZsNPmu=M1pXuc=Fg6sz7UP600baGSYV_pA@mail.gmail.com' \
    --to=libc-alpha@sourceware.org \
    --cc=bug-hurd@gnu.org \
    --cc=bugaevc@gmail.com \
    --cc=samuel.thibault@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).