summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--random.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 1c4b245..931ed41 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sun Oct 18 13:24:17 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * random.c (fill_random_bytes_syscall): use ATOMIC_SET() for
+ updating try_syscall.
+
Sun Oct 18 13:03:52 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
* include/ruby/backward/util.h: Good-by Borland-C.
diff --git a/random.c b/random.c
index 9f39dc2..4a9d4de 100644
--- a/random.c
+++ b/random.c
@@ -531,7 +531,7 @@ fill_random_bytes_syscall(void *seed, size_t size)
errno = 0;
ret = syscall(SYS_getrandom, seed, size, GRND_NONBLOCK);
if (errno == ENOSYS) {
- try_syscall = 0;
+ ATOMIC_SET(try_syscall, 0);
return -1;
}
if ((size_t)ret == size) return 0;