From 1912e6a69419d4448795ae1451c7b7c57ac16a52 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Mon, 8 Aug 2016 18:01:32 +0200 Subject: startup: Make the kernel a child of startup. * startup/startup.c (frob_kernel_process): Make the kernel a child of startup, improve error reporting. --- startup/startup.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'startup/startup.c') diff --git a/startup/startup.c b/startup/startup.c index 30984542..49ba9ce4 100644 --- a/startup/startup.c +++ b/startup/startup.c @@ -900,6 +900,12 @@ frob_kernel_process (void) error (0, err, "cannot get kernel task port"); return; } + + /* Make the kernel our child. */ + err = proc_child (procserver, task); + if (err) + error (0, err, "cannot make the kernel our child"); + err = proc_task2proc (procserver, task, &proc); if (err) { @@ -910,7 +916,9 @@ frob_kernel_process (void) /* Mark the kernel task as an essential task so that we or the proc server never want to task_terminate it. */ - proc_mark_important (proc); + err = proc_mark_important (proc); + if (err) + error (0, err, "cannot mark the kernel as important"); err = record_essential_task ("kernel", task); assert_perror (err); -- cgit v1.2.3