diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1999-09-16 09:40:33 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1999-09-16 09:40:33 +0000 |
commit | 9e3d9a2a009d2a0281802a84e1c5cc1c887edc71 (patch) | |
tree | ea994af7deeef43977f60a9ab26131e8cd90a9a0 /random.c | |
parent | 69a3aaf154948d653fa3653cd2b3c3b3af979769 (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.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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); |