public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: Laurent Vivier <lvivier@redhat.com>
To: Peter Foley <pefoley@google.com>, passt-dev@passt.top
Subject: Re: [PATCH] Fix build when HAS_GETRANDOM is undefined
Date: Tue, 24 Feb 2026 09:01:31 +0100	[thread overview]
Message-ID: <dfe002ec-9bc5-4aa4-b41a-6bbde295e950@redhat.com> (raw)
In-Reply-To: <20260223172739.144834-1-pefoley@google.com>

On 2/23/26 18:27, Peter Foley wrote:
> e.g.
> util.c:1163:14: error: use of undeclared identifier 'dev_random'; did you mean 'raw_random'?
>   1163 |                 ret = read(dev_random, (char *)buf + random_read,
> 
> Signed-off-by: Peter Foley <pefoley@google.com>
> ---
>   util.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/util.c b/util.c
> index db27431..a4f2be4 100644
> --- a/util.c
> +++ b/util.c
> @@ -1160,7 +1160,7 @@ void raw_random(void *buf, size_t buflen)
>   		ret = getrandom((char *)buf + random_read,
>   				buflen - random_read, GRND_RANDOM);
>   #else
> -		ret = read(dev_random, (char *)buf + random_read,
> +		ret = read(fd, (char *)buf + random_read,
>   			   buflen - random_read);
>   #endif
>   
> @@ -1177,7 +1177,7 @@ void raw_random(void *buf, size_t buflen)
>   	}
>   
>   #ifndef HAS_GETRANDOM
> -	close(dev_random);
> +	close(fd);
>   #endif
>   
>   	if (random_read < buflen)

Fixes: 71d5deed5eed ("util: Add general low-level random bytes helper")
Reviewed-by: Laurent Vivier <lvivier@redhat.com>


  parent reply	other threads:[~2026-02-24  8:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-23 17:27 Peter Foley
2026-02-24  5:47 ` David Gibson
2026-02-24  8:01 ` Laurent Vivier [this message]
2026-02-24 11:57 ` Stefano Brivio

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=dfe002ec-9bc5-4aa4-b41a-6bbde295e950@redhat.com \
    --to=lvivier@redhat.com \
    --cc=passt-dev@passt.top \
    --cc=pefoley@google.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.
Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

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 IMAP folder(s).