random: Fix previous commit for getentropy function.
authorNIIBE Yutaka <gniibe@fsij.org>
Tue, 15 Jan 2019 06:48:25 +0000 (15:48 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Tue, 15 Jan 2019 06:48:25 +0000 (15:48 +0900)
* random/rndlinux.c [__NR_getrandom] (_gcry_rndlinux_gather_random):
Check return value only for use of syscall.

--

The function returns 0 on success.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
random/rndlinux.c

index d71261c..04e2a46 100644 (file)
@@ -281,9 +281,11 @@ _gcry_rndlinux_gather_random (void (*add)(const void*, size_t,
               if (ret == -1)
                 log_fatal ("unexpected error from getentropy: %s\n",
                            strerror (errno));
+#ifdef __NR_getrandom
               else if (ret != nbytes)
                 log_fatal ("getentropy returned only"
                            " %ld of %zu requested bytes\n", ret, nbytes);
+#endif
 
               (*add)(buffer, nbytes, origin);
               length -= nbytes;