util-random: fix detection of getrandom failure

pull/3386/head
Eric Leblond 7 years ago
parent 851efd9c60
commit 325f336f63

@ -89,7 +89,7 @@ long int RandomGet(void)
/* ret should be sizeof(value), but if it is > 0 and < sizeof(value)
* it's still better than nothing so we return what we have */
if (ret <= 0) {
if (ret == -ENOSYS) {
if (ret == -1 && errno == ENOSYS) {
#if defined(HAVE_CLOCK_GETTIME)
return RandomGetClock();
#else

Loading…
Cancel
Save