diff options
author | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-10-18 05:42:08 +0000 |
---|---|---|
committer | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-10-18 05:42:08 +0000 |
commit | 38b6ffb812914ceadbe2ad9acea2bb618c48e82c (patch) | |
tree | d3852be800e122f1066c51503f0f6ce434a103b3 | |
parent | a26f9c0161ccbd71bb04d050ffba08442d18a761 (diff) | |
download | ruby-38b6ffb812914ceadbe2ad9acea2bb618c48e82c.tar.gz |
* 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
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | random.c | 2 |
2 files changed, 6 insertions, 1 deletions
@@ -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. @@ -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; |