diff --git a/NEWS b/NEWS index 2a40238d0a..4eadd9e51d 100644 --- a/NEWS +++ b/NEWS @@ -50,6 +50,8 @@ The following bugs are resolved with this release: saved registers [31429] build: Glibc failed to build with -march=x86-64-v3 [31501] dynamic-link: _dl_tlsdesc_dynamic_xsavec may clobber %rbx + [31612] libc: arc4random fails to fallback to /dev/urandom if + getrandom is not present [31640] dynamic-link: POWER10 ld.so crashes in elf_machine_load_address with GCC 14 [31676] Configuring with CC="gcc -march=x86-64-v3" diff --git a/stdlib/arc4random.c b/stdlib/arc4random.c index 3ae8fc1302..7818cb9cf6 100644 --- a/stdlib/arc4random.c +++ b/stdlib/arc4random.c @@ -51,7 +51,7 @@ __arc4random_buf (void *p, size_t n) n -= l; continue; /* Interrupted by a signal; keep going. */ } - else if (l == -ENOSYS) + else if (l < 0 && errno == ENOSYS) break; /* No syscall, so fallback to /dev/urandom. */ arc4random_getrandom_failure (); }