diff options
author | Peter Jones <pjones@redhat.com> | 2009-08-04 11:50:47 -0400 |
---|---|---|
committer | Peter Jones <pjones@redhat.com> | 2009-08-04 11:52:52 -0400 |
commit | 81cc86e56a897fc3778e1ee806600bfce2af4311 (patch) | |
tree | 759a6ff9b9401cad42180498d0c00296f1d3d30a /loader | |
parent | 1ee4b82d95023a03d94df23769c425312d12c276 (diff) | |
download | anaconda-81cc86e56a897fc3778e1ee806600bfce2af4311.tar.gz anaconda-81cc86e56a897fc3778e1ee806600bfce2af4311.tar.xz anaconda-81cc86e56a897fc3778e1ee806600bfce2af4311.zip |
Fix ctrl-alt-deleter behavior /before/ end of install.
The new reboot code didn't take into account the fact that there's a
different sigint handler while anaconda is running vs when we're done
installing. This patch fixes that bad assumption.
Diffstat (limited to 'loader')
-rw-r--r-- | loader/init.c | 1 | ||||
-rw-r--r-- | loader/init.h | 2 | ||||
-rw-r--r-- | loader/shutdown.c | 8 |
3 files changed, 8 insertions, 3 deletions
diff --git a/loader/init.c b/loader/init.c index ff0f62ef8..8037de0a8 100644 --- a/loader/init.c +++ b/loader/init.c @@ -395,6 +395,7 @@ static void termReset(void) { /* reboot handler */ static void sigintHandler(int signum) { termReset(); + shouldReboot = 1; shutDown(getKillPolicy(), REBOOT); } diff --git a/loader/init.h b/loader/init.h index 733bc8e68..413c8ba3c 100644 --- a/loader/init.h +++ b/loader/init.h @@ -25,4 +25,6 @@ typedef enum { HALT } reboot_action; +extern int shouldReboot; + #endif /* INIT_H */ diff --git a/loader/shutdown.c b/loader/shutdown.c index 54fd9a53b..5ba8fc64b 100644 --- a/loader/shutdown.c +++ b/loader/shutdown.c @@ -85,7 +85,7 @@ static void performReboot(reboot_action rebootAction) { } } -static int shouldReboot = 0; +int shouldReboot = 0; static void rebootHandler(int signum) { shouldReboot = 1; @@ -98,16 +98,18 @@ void shutDown(int doKill, reboot_action rebootAction) { if (!doKill) performReboot(rebootAction); } + + if (!shouldReboot && rebootAction != REBOOT) + printf("you may safely reboot your system\n"); - printf("you may safely reboot your system\n"); signal(SIGINT, rebootHandler); while (1) { - sleep(1); if (shouldReboot) { performUnmounts(1); performTerminations(1); performReboot(REBOOT); } + sleep(1); } exit(0); |