Commit eaf63d31 authored by Ondřej Zajíček's avatar Ondřej Zajíček

Better initialization of random generator

Use full time precision to initialize random generator. The old
code was prone to initialize it to the same values in specific
circumstances (boot without RTC, multiple VMs starting at once).
parent 70fab178
Pipeline #35955 passed with stages
in 5 minutes and 49 seconds
......@@ -2144,7 +2144,9 @@ io_init(void)
// XXX init_times();
// XXX update_times();
boot_time = current_time();
srandom((uint) (current_real_time() TO_S));
u64 now = (u64) current_real_time();
srandom((uint) (now ^ (now >> 32)));
}
static int short_loops = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment