summaryrefslogtreecommitdiff
path: root/random.c
diff options
context:
space:
mode:
Diffstat (limited to 'random.c')
-rw-r--r--random.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/random.c b/random.c
index b66f5cb..8e03e8f 100644
--- a/random.c
+++ b/random.c
@@ -521,12 +521,13 @@ fill_random_bytes_syscall(void *seed, size_t size)
{
static rb_atomic_t try_syscall = 1;
if (try_syscall) {
+ int ret;
errno = 0;
- ret = syscall(SYS_getrandom, seed, size, 0)
- if (errno == ENOSYS) {
- try_syscall = 0;
- return -1;
- }
+ ret = syscall(SYS_getrandom, seed, size, 0);
+ if (errno == ENOSYS) {
+ try_syscall = 0;
+ return -1;
+ }
if ((size_t)ret == size) return 0;
}
return -1;