From 8ff13a86d9a26a479164ea251eb0d3c00b95c726 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Fri, 22 Apr 2016 02:53:44 +0200 Subject: [PATCH hurd 2/2] xxx halt hack --- sutils/halt.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/sutils/halt.c b/sutils/halt.c index 08f754c..4d36ca2 100644 --- a/sutils/halt.c +++ b/sutils/halt.c @@ -25,6 +25,8 @@ #include #include #include +#include +#include #include const char *argp_program_version = STANDARD_HURD_VERSION (halt); @@ -32,9 +34,17 @@ const char *argp_program_version = STANDARD_HURD_VERSION (halt); int main (int argc, char *argv[]) { + error_t err; + file_t server; struct argp argp = {0, 0, 0, "Halt the system"}; argp_parse (&argp, argc, argv, 0, 0, 0); - reboot (RB_HALT); - error (1, errno, "reboot"); + + server = file_name_lookup (_SERVERS_STARTUP, 0, 0); + if (! MACH_PORT_VALID (server)) + error (1, errno, _HURD_STARTUP); + + err = startup_reboot (server, MACH_PORT_NULL, RB_HALT); + if (err) + error (1, err, "reboot"); return 1; } -- 2.1.4