Fix random function detection with static PIE builds
Some checks failed
CI - Python / Check (push) Has been cancelled
CI - Ubuntu / Build (push) Has been cancelled
CI - File health / Check (push) Has been cancelled
CI - macOS / Build (push) Has been cancelled
CI - Windows / Build (push) Has been cancelled
CI - WebUI / Check (push) Has been cancelled

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

Closes #22981.
PR #22987.
This commit is contained in:
Chocobo1 2025-07-15 01:56:04 +08:00 committed by GitHub
commit 7c443b0c3b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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)
{