summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--random.c11
2 files changed, 10 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 92fac09..2faa64d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Tue Jul 7 18:18:41 2015 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * random.c (fill_random_bytes_syscall): fix compile error.
+
Tue Jul 7 16:47:30 2015 Eric Wong <e@80x24.org>
* compile.c (COMPILE_ERROR): reduce GET_THREAD() calls
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;