mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
core: Use /dev/urandom for getrandom fallback
Sami Farin pointed out on #833 that on Linux kernels older than 5.6, /dev/random blocks when entropy estimates are too low, whereas /dev/urandom does not. Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
parent
3509962f3a
commit
f6b1d65e35
1 changed files with 1 additions and 1 deletions
|
|
@ -38,7 +38,7 @@
|
|||
#include <fcntl.h>
|
||||
|
||||
ssize_t getrandom(void *buf, size_t buflen, unsigned int flags) {
|
||||
int fd = open("/dev/random", O_CLOEXEC);
|
||||
int fd = open("/dev/urandom", O_CLOEXEC);
|
||||
if (fd < 0)
|
||||
return -1;
|
||||
ssize_t bytes = read(fd, buf, buflen);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue