From 9a4067dc5bd3d810ce4b1d9dd8ba394dee4c247b Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sun, 9 Nov 2008 15:40:18 -0800 Subject: [PATCH] Mark shutdown_reboot() and shutdown_power_off() as NO_RETURN. Also, make shutdown_reboot() actually behave that way, by trying to reboot forever instead of giving up after some number of tries. --- src/devices/shutdown.c | 8 +++----- src/devices/shutdown.h | 6 ++++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/devices/shutdown.c b/src/devices/shutdown.c index fbc662b..4c978f9 100644 --- a/src/devices/shutdown.c +++ b/src/devices/shutdown.c @@ -23,19 +23,17 @@ static void print_stats (void); void shutdown_reboot (void) { - int i; - printf ("Rebooting...\n"); /* See [kbd] for details on how to program the keyboard * controller. */ - for (i = 0; i < 100; i++) + for (;;) { - int j; + int i; /* Poll keyboard controller's status byte until * 'input buffer empty' is reported. */ - for (j = 0; j < 0x10000; j++) + for (i = 0; i < 0x10000; i++) { if ((inb (CONTROL_REG) & 0x02) == 0) break; diff --git a/src/devices/shutdown.h b/src/devices/shutdown.h index 0bc5657..7bcef19 100644 --- a/src/devices/shutdown.h +++ b/src/devices/shutdown.h @@ -1,7 +1,9 @@ #ifndef DEVICES_SHUTDOWN_H #define DEVICES_SHUTDOWN_H -void shutdown_reboot (void); -void shutdown_power_off (void); +#include + +void shutdown_reboot (void) NO_RETURN; +void shutdown_power_off (void) NO_RETURN; #endif /* devices/shutdown.h */ -- 2.30.2