bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v2] startup: Mark essential tasks as our children


From: Damien Zammit
Subject: [PATCH v2] startup: Mark essential tasks as our children
Date: Sun, 6 Jun 2021 11:49:02 +1000

This boots, but proc_child(fs) is needed in launch_core_servers
otherwise it hangs at " auth"

---
 startup/startup.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/startup/startup.c b/startup/startup.c
index 9faeb462..2499f81d 100644
--- a/startup/startup.c
+++ b/startup/startup.c
@@ -368,6 +368,10 @@ record_essential_task (const char *name, task_t task)
   /* Dead-name notification on the task port will tell us when it dies.  */
   request_dead_name (task);
 
+  /* Make task a child of startup */
+  if (task != mach_task_self () && task != proctask)
+    proc_child (procserver, task);
+
 #if 0
   /* Taking over the exception port will give us a better chance
      if the task tries to get wedged on a fault.  */
@@ -863,12 +867,12 @@ launch_core_servers (void)
   assert_perror_backtrace (err);
   proc_set_exe (procserver, "/hurd/startup");
 
-  /* Declare that the filesystem and auth are our children. */
-  err = proc_child (procserver, fstask);
-  assert_perror_backtrace (err);
-  err = proc_child (procserver, authtask);
+  /* XXX this seems required? */
+  err = record_essential_task ("fs", fstask);
   assert_perror_backtrace (err);
 
+  err = record_essential_task ("auth", authtask);
+  assert_perror_backtrace (err);
   err = proc_task2proc (procserver, authtask, &authproc);
   assert_perror_backtrace (err);
   err = proc_mark_important (authproc);
@@ -1053,8 +1057,7 @@ frob_kernel_process (void)
         }
     }
 
-  /* Make the kernel our child.  */
-  err = proc_child (procserver, task);
+  err = record_essential_task ("kernel", task);
   if (err)
     {
       error (0, err, "cannot make the kernel our child");
@@ -1075,9 +1078,6 @@ frob_kernel_process (void)
   if (err)
     error (0, err, "cannot mark the kernel as important");
 
-  err = record_essential_task ("kernel", task);
-  assert_perror_backtrace (err);
-
   proc_set_exe (proc, "kernel");
 
   err = task_get_bootstrap_port (task, &kbs);
-- 
2.31.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]