aboutsummaryrefslogtreecommitdiffstats
path: root/Packdrakeng/zlib.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Packdrakeng/zlib.pm')
-rw-r--r--Packdrakeng/zlib.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/Packdrakeng/zlib.pm b/Packdrakeng/zlib.pm
index 6d33d3e..03673d2 100644
--- a/Packdrakeng/zlib.pm
+++ b/Packdrakeng/zlib.pm
@@ -59,7 +59,8 @@ 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);
- my $wres = syswrite($pack->{handle}, $cbuf) == length($cbuf) or do {
+ my $wres = syswrite($pack->{handle}, $cbuf) || 0;
+ $wres == length($cbuf) or do {
warn "can't push all data to compressor";
return 0, 0;
};