summaryrefslogtreecommitdiff
path: root/random.c
diff options
context:
space:
mode:
authorsvn <svn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-02-10 08:21:39 +0000
committersvn <svn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-02-10 08:21:39 +0000
commit61ffc7a0aeaa15a618f61c9df753543fa443df96 (patch)
tree8096f32b0be1dbe938f111660ce9d931ed036877 /random.c
parent1a8583de72e12e139e9c7fbcfc026c2cbf410519 (diff)
* expand tabs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'random.c')
-rw-r--r--random.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/random.c b/random.c
index 704f78d..a21f684 100644
--- a/random.c
+++ b/random.c
@@ -398,21 +398,21 @@ fill_random_bytes_syscall(void *seed, size_t size, int need_secure)
{
static rb_atomic_t try_syscall = 1;
if (try_syscall) {
- ssize_t ret;
- size_t offset = 0;
- int flags = 0;
- if (!need_secure)
- flags = GRND_NONBLOCK;
- do {
- errno = 0;
- ret = getrandom(((char*)seed) + offset, size - offset, flags);
- if (ret == -1) {
- ATOMIC_SET(try_syscall, 0);
- return -1;
- }
- offset += (size_t)ret;
- } while(offset < size);
- return 0;
+ ssize_t ret;
+ size_t offset = 0;
+ int flags = 0;
+ if (!need_secure)
+ flags = GRND_NONBLOCK;
+ do {
+ errno = 0;
+ ret = getrandom(((char*)seed) + offset, size - offset, flags);
+ if (ret == -1) {
+ ATOMIC_SET(try_syscall, 0);
+ return -1;
+ }
+ offset += (size_t)ret;
+ } while(offset < size);
+ return 0;
}
return -1;
}