* [PATCH] Fix build when HAS_GETRANDOM is undefined
@ 2026-02-23 17:27 Peter Foley
0 siblings, 0 replies; only message in thread
From: Peter Foley @ 2026-02-23 17:27 UTC (permalink / raw)
To: passt-dev; +Cc: Peter Foley
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)
--
2.53.0.371.g1d285c8824-goog
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-02-23 17:27 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-23 17:27 [PATCH] Fix build when HAS_GETRANDOM is undefined Peter Foley
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).