Fix random function detection with static PIE builds

Certain build options didn't like the detection with an no-op. So make
it really fetch a random value.

Closes #22981.
This commit is contained in:
Chocobo1 2025-07-13 22:47:50 +08:00
commit 661092147d
No known key found for this signature in database
GPG key ID: 210D9C873253A68C

View file

@ -45,7 +45,7 @@ namespace
RandomLayer()
{
if (::getrandom(nullptr, 0, 0) < 0)
if (unsigned char buf = 0; ::getrandom(&buf, sizeof(buf), 0) < 0)
{
if (errno == ENOSYS)
{