From 325f336f637f8a3f4f2fb00c6cd6d0f04d5ca62f Mon Sep 17 00:00:00 2001 From: Eric Leblond Date: Thu, 24 May 2018 13:43:30 +0200 Subject: [PATCH] util-random: fix detection of getrandom failure --- src/util-random.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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