1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-07 06:43:00 +03:00

malloc: Do not clobber errno on __getrandom_nocancel (BZ #29624)

Use INTERNAL_SYSCALL_CALL instead of INLINE_SYSCALL_CALL.  This
requires emulate the semantic for hurd call (so __arc4random_buf
uses the fallback).

Checked on x86_64-linux-gnu.

Reviewed-by: Wilco Dijkstra  <Wilco.Dijkstra@arm.com>
This commit is contained in:
Adhemerval Zanella
2022-09-29 16:18:06 -03:00
parent 13db9ee2cb
commit 609c9d0951
3 changed files with 12 additions and 4 deletions

View File

@@ -51,7 +51,7 @@ __arc4random_buf (void *p, size_t n)
n -= l;
continue; /* Interrupted by a signal; keep going. */
}
else if (l < 0 && errno == ENOSYS)
else if (l == -ENOSYS)
break; /* No syscall, so fallback to /dev/urandom. */
arc4random_getrandom_failure ();
}