summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2014-01-19 13:12:08 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2014-01-19 13:12:08 +0000
commit215ac718068a5e6371b91cc6baca0f648b336df3 (patch)
tree2b471714d361d8e6b571a3772ef04b1853604a3e /sys/kern
parentd6f7899fa7922743b1922b4e17f860e729048f3e (diff)
oops, forgotten part
Initialize ci_randseed better using arc4random() + a trick. Remove the libkern srandom() API since it is not suitable for this use. ok kettenis miod
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/init_main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c
index aa19b48cebd..254729598b1 100644
--- a/sys/kern/init_main.c
+++ b/sys/kern/init_main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: init_main.c,v 1.199 2014/01/19 00:39:40 deraadt Exp $ */
+/* $OpenBSD: init_main.c,v 1.200 2014/01/19 13:12:07 deraadt Exp $ */
/* $NetBSD: init_main.c,v 1.84.4.1 1996/06/02 09:08:06 mrg Exp $ */
/*
@@ -337,7 +337,7 @@ main(void *framep)
sched_init_runqueues();
sleep_queue_init();
sched_init_cpu(curcpu());
- srandom(arc4random());
+ p->p_curcpu->ci_randseed = (arc4random() & 0x7fffffff) + 1;
/* Initialize work queues */
workq_init();