summaryrefslogtreecommitdiff
path: root/sys/kern/init_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/init_main.c')
-rw-r--r--sys/kern/init_main.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c
index 2e8cade491a..eb6415b145f 100644
--- a/sys/kern/init_main.c
+++ b/sys/kern/init_main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: init_main.c,v 1.192 2013/12/01 16:40:56 krw Exp $ */
+/* $OpenBSD: init_main.c,v 1.193 2013/12/28 03:04:20 deraadt Exp $ */
/* $NetBSD: init_main.c,v 1.84.4.1 1996/06/02 09:08:06 mrg Exp $ */
/*
@@ -340,6 +340,9 @@ main(void *framep)
sleep_queue_init();
sched_init_cpu(curcpu());
+ random_start();
+ srandom(arc4random());
+
/* Initialize work queues */
workq_init();
taskq_init();
@@ -447,6 +450,8 @@ main(void *framep)
&initproc))
panic("fork init");
+ randompid = 1;
+
/*
* Create any kernel threads whose creation was deferred because
* initproc had not yet been created.
@@ -533,8 +538,6 @@ main(void *framep)
microtime(&rtv);
srandom((u_int32_t)(rtv.tv_sec ^ rtv.tv_usec) ^ arc4random());
- randompid = 1;
-
#if defined(MULTIPROCESSOR)
/* Boot the secondary processors. */
cpu_boot_secondary_processors();