Workaround ECAPMODE for kernels between revision [331280, 337999)

where getrandom(2) is not available in capability mode.
This commit is contained in:
Xin LI 2018-08-18 08:32:21 +00:00
parent ed1fa01ac4
commit 52809cc35b

View File

@ -85,7 +85,7 @@ getentropy(void *buf, size_t buflen)
if (rd == -1) { if (rd == -1) {
if (errno == EINTR) if (errno == EINTR)
continue; continue;
else if (errno == ENOSYS) else if (errno == ENOSYS || errno == ECAPMODE)
return (getentropy_fallback(buf, buflen)); return (getentropy_fallback(buf, buflen));
else else
return (-1); return (-1);