summaryrefslogtreecommitdiff
path: root/random.c
diff options
context:
space:
mode:
authorkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-18 05:42:08 (GMT)
committerkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-18 05:42:08 (GMT)
commita4c6ad1d1978f1b6007fbe5b0cc5b1abaee67d1a (patch)
treed3852be800e122f1066c51503f0f6ce434a103b3 /random.c
parent0bdf13a10424d28f109292329892aef71a30a18c (diff)
* random.c (fill_random_bytes_syscall): use ATOMIC_SET() for
updating try_syscall. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52179 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'random.c')
-rw-r--r--random.c2
1 files changed, 1 insertions, 1 deletions
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;