diff options
Diffstat (limited to 'Packdrakeng')
-rw-r--r-- | Packdrakeng/zlib.pm | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Packdrakeng/zlib.pm b/Packdrakeng/zlib.pm index d975060..6d33d3e 100644 --- a/Packdrakeng/zlib.pm +++ b/Packdrakeng/zlib.pm @@ -59,7 +59,11 @@ sub gzip_compress { while (my $lenght = sysread($sourcefh, my $buf, $pack->{bufsize})) { $pack->{cstream_data}{crc} = crc32($buf, $pack->{cstream_data}{crc}); my ($cbuf, $status) = $pack->{cstream_data}{object}->deflate($buf); - $outsize += syswrite($pack->{handle}, $cbuf); + my $wres = syswrite($pack->{handle}, $cbuf) == length($cbuf) or do { + warn "can't push all data to compressor"; + return 0, 0; + }; + $outsize += $wres; $insize += $lenght; } |