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.
PR #22987.
This commit is contained in:
Chocobo1
2025-07-15 01:56:04 +08:00
committed by Vladimir Golovnev (Glassez)
parent d76712256c
commit a76f12f3db

View File

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