From a14b91302728610e6701fe1260c2396f0316b695 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Wed, 23 May 2012 18:26:36 +0000 Subject: (sig_segv_handler) split it out of main() --- perl-install/install/install2.pm | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'perl-install/install') diff --git a/perl-install/install/install2.pm b/perl-install/install/install2.pm index 3ff611c30..68e018644 100644 --- a/perl-install/install/install2.pm +++ b/perl-install/install/install2.pm @@ -334,19 +334,21 @@ sub init_local_install { $o->{mouse} = mouse::fullname2mouse('Universal|Any PS/2 & USB mice'); } +sub sig_segv_handler() { + my $msg = "segmentation fault: install crashed (maybe memory is missing?)\n" . backtrace(); + log::l("$msg\n"); + # perl_checker: require UNIVERSAL + UNIVERSAL::can($o, 'ask_warn') and $o->ask_warn('', $msg); + setVirtual(1); + require install::steps_auto_install; + install::steps_auto_install_non_interactive::errorInStep($o, $msg); +} + #-###################################################################################### #- MAIN #-###################################################################################### sub main { - $SIG{SEGV} = sub { - my $msg = "segmentation fault: install crashed (maybe memory is missing?)\n" . backtrace(); - log::l("$msg\n"); - # perl_checker: require UNIVERSAL - UNIVERSAL::can($o, 'ask_warn') and $o->ask_warn('', $msg); - setVirtual(1); - require install::steps_auto_install; - install::steps_auto_install_non_interactive::errorInStep($o, $msg); - }; + $SIG{SEGV} = \&sig_segv_handler; $ENV{PERL_BADLANG} = 1; delete $ENV{TERMINFO}; umask 022; -- cgit v1.2.1