From 9118ef2b3fb1053b9a9c7f8073a8810120be9502 Mon Sep 17 00:00:00 2001 From: Olivier Thauvin Date: Tue, 21 Dec 2004 22:29:33 +0000 Subject: - check data are really writen --- Packdrakeng/zlib.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; } -- cgit v1.2.1