From: Eric Leblond Date: Thu, 24 May 2018 11:43:30 +0000 (+0200) Subject: util-random: fix detection of getrandom failure X-Git-Tag: suricata-4.1.0-rc1~75 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=325f336f637f8a3f4f2fb00c6cd6d0f04d5ca62f;p=thirdparty%2Fsuricata.git util-random: fix detection of getrandom failure --- diff --git a/src/util-random.c b/src/util-random.c index 5a709dc66c..b2945e53b6 100644 --- a/src/util-random.c +++ b/src/util-random.c @@ -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