]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
util-random: fix detection of getrandom failure 3386/head
authorEric Leblond <eric@regit.org>
Thu, 24 May 2018 11:43:30 +0000 (13:43 +0200)
committerEric Leblond <eric@regit.org>
Thu, 24 May 2018 13:25:09 +0000 (15:25 +0200)
src/util-random.c

index 5a709dc66cdd8da7dd7fb46022f825b439635371..b2945e53b69c1ce1fde8e166416218f0580dddb9 100644 (file)
@@ -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