summaryrefslogtreecommitdiff
path: root/random.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-03-11 22:03:36 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-03-11 22:03:36 (GMT)
commitb87f2fe1e44acd66a30fad24bad2d21ddb01e8a2 (patch)
treed7b59c53d45e52d07bc13ff05858d59c844cbd09 /random.c
parent06279f0e4a901d57030d9dd7b3b7f39ad796ee09 (diff)
* random.c (random_s_rand): ensure default PRNG is re-initialized
after fork. patched by Eric Wong. [ruby-core:41209][Bug #5661] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'random.c')
-rw-r--r--random.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/random.c b/random.c
index d5a2dd8..9405ff1 100644
--- a/random.c
+++ b/random.c
@@ -1293,6 +1293,7 @@ rb_f_rand(int argc, VALUE *argv, VALUE obj)
static VALUE
random_s_rand(int argc, VALUE *argv, VALUE obj)
{
+ rand_start(&default_rand);
return random_rand(argc, argv, rb_Random_DEFAULT);
}