diff options
| author | Jeff Garzik <jgarzik@pretzel.yyz.us> | 2005-06-26 23:38:58 -0400 |
|---|---|---|
| committer | Jeff Garzik <jgarzik@pobox.com> | 2005-06-26 23:38:58 -0400 |
| commit | 5696c1944a33b4434a9a1ebb6383b906afd43a10 (patch) | |
| tree | 16fbe6ba431bcf949ee8645510b0c2fd39b5810f /arch/um/kernel/main.c | |
| parent | 66b04a80eea60cabf9d89fd34deb3234a740052f (diff) | |
| parent | 020f46a39eb7b99a575b9f4d105fce2b142acdf1 (diff) | |
| download | lwn-5696c1944a33b4434a9a1ebb6383b906afd43a10.tar.gz lwn-5696c1944a33b4434a9a1ebb6383b906afd43a10.zip | |
Merge /spare/repo/linux-2.6/
Diffstat (limited to 'arch/um/kernel/main.c')
| -rw-r--r-- | arch/um/kernel/main.c | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/arch/um/kernel/main.c b/arch/um/kernel/main.c index a17c49703f9b..1e1a87f1c510 100644 --- a/arch/um/kernel/main.c +++ b/arch/um/kernel/main.c @@ -24,8 +24,6 @@ #include "mode.h" #include "choose-mode.h" #include "uml-config.h" -#include "irq_user.h" -#include "time_user.h" #include "os.h" /* Set in set_stklim, which is called from main and __wrap_malloc. @@ -71,7 +69,6 @@ static __init void do_uml_initcalls(void) static void last_ditch_exit(int sig) { - CHOOSE_MODE(kmalloc_ok = 0, (void) 0); signal(SIGINT, SIG_DFL); signal(SIGTERM, SIG_DFL); signal(SIGHUP, SIG_DFL); @@ -87,7 +84,7 @@ int main(int argc, char **argv, char **envp) { char **new_argv; sigset_t mask; - int ret, i; + int ret, i, err; /* Enable all signals except SIGIO - in some environments, we can * enter with some signals blocked @@ -160,27 +157,29 @@ int main(int argc, char **argv, char **envp) */ change_sig(SIGPROF, 0); - /* Reboot */ - if(ret){ - int err; + /* This signal stuff used to be in the reboot case. However, + * sometimes a SIGVTALRM can come in when we're halting (reproducably + * when writing out gcov information, presumably because that takes + * some time) and cause a segfault. + */ - printf("\n"); + /* stop timers and set SIG*ALRM to be ignored */ + disable_timer(); - /* stop timers and set SIG*ALRM to be ignored */ - disable_timer(); + /* disable SIGIO for the fds and set SIGIO to be ignored */ + err = deactivate_all_fds(); + if(err) + printf("deactivate_all_fds failed, errno = %d\n", -err); - /* disable SIGIO for the fds and set SIGIO to be ignored */ - err = deactivate_all_fds(); - if(err) - printf("deactivate_all_fds failed, errno = %d\n", - -err); - - /* Let any pending signals fire now. This ensures - * that they won't be delivered after the exec, when - * they are definitely not expected. - */ - unblock_signals(); + /* Let any pending signals fire now. This ensures + * that they won't be delivered after the exec, when + * they are definitely not expected. + */ + unblock_signals(); + /* Reboot */ + if(ret){ + printf("\n"); execvp(new_argv[0], new_argv); perror("Failed to exec kernel"); ret = 1; |
