From c36e6bbe9366b30c5b072997698e4e78947b446f Mon Sep 17 00:00:00 2001
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date: Sat, 3 Dec 2022 20:31:03 +0100
Subject: startup: Make essential tasks essential to mach

Whenever a Hurd essential task crashes, startup just reboots the system
since there's not much that can be done at that point. When we have a
kernel debugger, however, we could at least get crashing information, so
let's make Hurd's startup tell the kernel which tasks are essential, so
it can trigger the debugger whenever they crash.
---
 startup/startup.c | 2 ++
 1 file changed, 2 insertions(+)

(limited to 'startup/startup.c')

diff --git a/startup/startup.c b/startup/startup.c
index 1e3a65fb..e8c76d80 100644
--- a/startup/startup.c
+++ b/startup/startup.c
@@ -1493,6 +1493,8 @@ S_startup_essential_task (mach_port_t server,
   if (fail)
     return fail;
 
+  task_set_essential (task, TRUE);
+
   /* Always deallocate the extra reference this message carries.  */
   if (MACH_PORT_VALID (credential))
     mach_port_deallocate (mach_task_self (), credential);
-- 
cgit v1.2.3