summaryrefslogtreecommitdiff
path: root/random.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-09-16 09:40:33 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-09-16 09:40:33 +0000
commit9e3d9a2a009d2a0281802a84e1c5cc1c887edc71 (patch)
treeea994af7deeef43977f60a9ab26131e8cd90a9a0 /random.c
parent69a3aaf154948d653fa3653cd2b3c3b3af979769 (diff)
1.4.1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@527 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'random.c')
-rw-r--r--random.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/random.c b/random.c
index e78225c..e977094 100644
--- a/random.c
+++ b/random.c
@@ -92,10 +92,11 @@ rb_f_srand(argc, argv, obj)
static int saved_seed;
if (rb_scan_args(argc, argv, "01", &seed) == 0) {
+ static int n = 0;
struct timeval tv;
gettimeofday(&tv, 0);
- seed = tv.tv_sec ^ tv.tv_usec ^ getpid();
+ seed = tv.tv_sec ^ tv.tv_usec ^ getpid() ^ n++;
}
else {
seed = NUM2UINT(seed);