summaryrefslogtreecommitdiff
path: root/fml/libexec
diff options
context:
space:
mode:
authorfukachan <fukachan>2004-05-24 13:58:33 +0000
committerfukachan <fukachan>2004-05-24 13:58:33 +0000
commitfbbf14c3e866b4923d77d82fb618c78d10d0c79b (patch)
tree82b374d7d9fb34bbaaa5c7fa876e326103b8fcad /fml/libexec
parentace7270a328a37f33e2c3bc8ae9ff8f2af0a9804 (diff)
downloadfml8-fbbf14c3e866b4923d77d82fb618c78d10d0c79b.tar.gz
fml8-fbbf14c3e866b4923d77d82fb618c78d10d0c79b.tar.bz2
fml8-fbbf14c3e866b4923d77d82fb618c78d10d0c79b.zip
define global variable $ERROR_EXIT_CODE for emergency handling.
run exit($ERROR_EXIT_CODE) if error.
Diffstat (limited to 'fml/libexec')
-rwxr-xr-xfml/libexec/loader.in14
1 files changed, 9 insertions, 5 deletions
diff --git a/fml/libexec/loader.in b/fml/libexec/loader.in
index 635b50f1..653e6d7f 100755
--- a/fml/libexec/loader.in
+++ b/fml/libexec/loader.in
@@ -4,13 +4,13 @@
# Copyright (C) 2000-2002 Ken'ichi Fukamachi
# All rights reserved.
#
-# $FML: loader.in,v 1.10 2002/04/01 23:41:17 fukachan Exp $
+# $FML: loader.in,v 1.11 2002/09/24 14:19:50 fukachan Exp $
#
eval 'exec @PERL@ -S $0 ${1+"$@"}'
if $running_under_some_shell;
-use vars qw($running_under_some_shell $hints);
+use vars qw($running_under_some_shell $hints $ERROR_EXIT_CODE);
use strict;
use IO::File;
@@ -18,6 +18,10 @@ use IO::File;
$ENV{'PATH'} = '/bin:/usr/bin';
delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
+# XXX irregular global variable permitted to handle emergency cases.
+# default exit code in error.
+$ERROR_EXIT_CODE = 1;
+
# main routine to boot off
{
my $prefix = "@prefix@";
@@ -30,10 +34,10 @@ delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
eval q{ Bootstrap($main_cf);};
# not use Carp.pm to be quiet if needed
- if ($@) { print STDERR "Error: ", $@, "\n"; exit 1;}
+ if ($@) { print STDERR "Error: ", $@, "\n"; exit($ERROR_EXIT_CODE);}
}
-exit 0;
+exit(0);
=head1 NAME
@@ -258,7 +262,7 @@ sub __CROAK
print STDERR "fml loader error: $reason\n";
print STDERR " reason(detail): $detail\n" if defined $detail;
- exit(1);
+ exit($ERROR_EXIT_CODE);
}