summaryrefslogtreecommitdiff
path: root/random.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-01-17 08:37:53 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-01-17 08:37:53 +0000
commitdde62bcd2efbb3825d982326896ab774e73e4218 (patch)
tree6a421d3818dd390cf8f6b2c5544726a8950e1401 /random.c
parente43877719bd4bbd12e493e896a0f98c5b349937b (diff)
2000-01-17
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@606 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'random.c')
-rw-r--r--random.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/random.c b/random.c
index e8c9d1cb28..99f4c59bf2 100644
--- a/random.c
+++ b/random.c
@@ -76,8 +76,8 @@ void srand48 _((long));
#endif /* not HAVE_DRAND48 */
-#ifdef HAVE_RANDOM
static int first = 1;
+#if !defined HAVE_DRAND48 && defined HAVE_RANDOM
static char state[256];
#endif
@@ -88,15 +88,15 @@ rand_init(seed)
int old;
static unsigned int saved_seed;
-#ifdef HAVE_RANDOM
+#if !defined HAVE_DRAND48 && defined HAVE_RANDOM
if (first == 1) {
initstate(1, state, sizeof state);
- first = 0;
}
else {
setstate(state);
}
#endif
+ first = 0;
SRANDOM(seed);
old = saved_seed;
@@ -135,8 +135,6 @@ rb_f_rand(obj, vmax)
{
long val, max;
- static initialized = 0;
-
if (first) {
struct timeval tv;