From: Frank Brehm Date: Mon, 3 Apr 2006 09:13:46 +0000 (+0000) Subject: Bugfixing X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=a1b4de1c9c1d20943e2fe451c5e5234ec2a8c936;p=scripts%2Fsolaris.git Bugfixing --- diff --git a/LogRotate.pm b/LogRotate.pm index 638a161..731ec96 100644 --- a/LogRotate.pm +++ b/LogRotate.pm @@ -680,7 +680,7 @@ sub compress_file_bzip2($$) { return undef; } - unless ( $bz = eval " bzopen( '$target', 'w' )" ) { + unless ( $bz = Compress::Bzip2::bzopen( $target, 'w' ) ) { warn $p . "Kann komprimierte Datei '$target' nicht schreiben: $!.\n"; close LOG; return undef; @@ -788,23 +788,27 @@ sub compress_file_zlib($$) { my $every = $blocks > 70 ? int( $blocks / 70 ) + 1 : 1; my $i = 0; my $target = $file . $ce; - my $strategy = eval "Z_DEFAULT_STRATEGY"; + my $strategy = eval("Compress::Zlib::Z_DEFAULT_STRATEGY;"); my ( $gz, $buffer ); my ( @Stat ); + print $p . "Oeffne '$file' zum Lesen ...\n" if verbose() > 1; unless ( open LOG, "<", "$file" ) { warn $p . "Problem beim Oeffnen der Logdatei '$file' zum Lesen: $!\n"; return undef; } - unless ( $gz = eval " gzopen( '$target', 'wb' )" ) { + print $p . "Oeffne '$target' zum komprimierten Schreiben ...\n" if verbose() > 1; + unless ( $gz = Compress::Zlib::gzopen( $target, 'wb' ) ) { warn $p . "Kann komprimierte Datei '$target' nicht schreiben: $!.\n"; close LOG; return undef; } - print " "; + print $p . "Setze Kompressions-Parameter auf Level '$level' und Strategie auf '$strategy'.\n" if verbose() > 2; $gz->gzsetparams( $level, $strategy ); + + print " "; while ( read LOG, $buffer, default_buffer_size ) { $i++; $gz->gzwrite( $buffer ); diff --git a/logrotate.pl b/logrotate.pl index 421da8f..2f03227 100755 --- a/logrotate.pl +++ b/logrotate.pl @@ -143,7 +143,7 @@ if ( $version ) { } $test = 1 if $Debug; -$test = 1; +#$test = 1; if ( $Debug ) { $verbose = $Debug unless $verbose;