1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
kosaki 2015-10-18 05:42:08 +00:00
parent 0bdf13a104
commit a4c6ad1d19
2 changed files with 6 additions and 1 deletions

View file

@ -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.

View file

@ -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;