bug-hurd
[Top][All Lists]
Advanced

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

Re: [PATCH v3] hurd: Make getrandom cache the server port


From: Sergey Bugaev
Subject: Re: [PATCH v3] hurd: Make getrandom cache the server port
Date: Fri, 2 Dec 2022 17:04:38 +0300

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 via email to

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