marsadm: verbose callstack at ldie

This commit is contained in:
Thomas Schoebel-Theuer 2016-02-12 07:36:29 +01:00
parent dd4748bb52
commit 20eca8c447
1 changed files with 17 additions and 4 deletions

View File

@ -29,6 +29,15 @@ umask 0077;
##################################################################
# global defaults
my $threshold = 10 * 1024 * 1024;
my $window = 30;
my $verbose = 0;
my $dry_run = 0;
##################################################################
# messaging
my $error_count = 0;
@ -58,6 +67,14 @@ sub lprint_stderr {
sub ldie {
my ($text) = @_;
if ($verbose > 2) {
my $i = 1;
for (;;) {
my ($package, $filename, $line, $subroutine, $hasargs, $wantarray, $evaltext, $is_require, $hints, $bitmask, $hinthash) = caller($i++);
last unless defined($subroutine);
lprint_stderr "$line:$subroutine\n";
}
}
$error_count++;
lprint_stderr "DYING: $text";
llog("DYING: $text");
@ -110,10 +127,6 @@ sub correct_path {
my @link_list = ();
my %link_hash;
my $threshold = 10 * 1024 * 1024;
my $window = 30;
my $verbose = 0;
my $dry_run = 0;
sub get_link {
my ($path, $unchecked) = @_;