diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2019-03-02 15:36:06 -0800 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2019-03-03 11:35:18 +0100 |
commit | 28050d6310c7bd0817e83aac8b4cb27b518f4267 (patch) | |
tree | 88add2b6ca32c1234b2cf35998d1acd04098a614 /startup | |
parent | efd8361ef4354dadf14172563f12e8e00d1b091a (diff) | |
download | hurd-28050d6310c7bd0817e83aac8b4cb27b518f4267.tar.gz hurd-28050d6310c7bd0817e83aac8b4cb27b518f4267.tar.bz2 hurd-28050d6310c7bd0817e83aac8b4cb27b518f4267.zip |
shutdown: fallback on Mach shutdown
* startup/startup.c (reboot_mach): In case do_shutdown returns, fallback to
Mach's host_reboot.
Diffstat (limited to 'startup')
-rw-r--r-- | startup/startup.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/startup/startup.c b/startup/startup.c index 3ca38e64..33b5b9f2 100644 --- a/startup/startup.c +++ b/startup/startup.c @@ -206,16 +206,21 @@ reboot_mach (int flags) else { error_t err; - fprintf (stderr, "%s: %sing Mach (flags %#x)...\n", - program_invocation_short_name, BOOT (flags), flags); sleep (5); if (flags & RB_HALT) { - do_shutdown(); - } else { - err = host_reboot (host_priv, flags); - if (err) - error (1, err, "reboot"); + fprintf (stderr, "%s: %sing Hurd...\n", + program_invocation_short_name, BOOT (flags)); + err = do_shutdown (); + if (err) + error (0, err, "shutdown"); + sleep (2); + fprintf (stderr, "Didn't succeed\n"); } + fprintf (stderr, "%s: %sing Mach (flags %#x)...\n", + program_invocation_short_name, BOOT (flags), flags); + err = host_reboot (host_priv, flags); + if (err) + error (1, err, "reboot"); for (;;) sleep (1); } } |