diff options
| author | NIIBE Yutaka <gniibe@fsij.org> | 2019-01-15 15:48:25 +0900 |
|---|---|---|
| committer | NIIBE Yutaka <gniibe@fsij.org> | 2019-01-15 15:48:25 +0900 |
| commit | 17f246c7044ab9ed236f6ec73fc126654257f0f9 (patch) | |
| tree | 27e5c7f81ea80ed09765ba8b2905c23809d57e7e /random | |
| parent | 2677d7d482bf2d078c1dce64854747c5b148924b (diff) | |
| download | libgcrypt-17f246c7044ab9ed236f6ec73fc126654257f0f9.tar.gz | |
random: Fix previous commit for getentropy function.
* 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>
Diffstat (limited to 'random')
| -rw-r--r-- | random/rndlinux.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/random/rndlinux.c b/random/rndlinux.c index d71261c2..04e2a464 100644 --- a/random/rndlinux.c +++ b/random/rndlinux.c @@ -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; |
