diff options
author | Olivier Thauvin <nanardon@mandriva.org> | 2004-12-21 22:29:33 +0000 |
---|---|---|
committer | Olivier Thauvin <nanardon@mandriva.org> | 2004-12-21 22:29:33 +0000 |
commit | 9118ef2b3fb1053b9a9c7f8073a8810120be9502 (patch) | |
tree | 9e8d3925f41c19d153f8b3936df746753581f185 | |
parent | cde5d14ee8dcc01db2d162cac51dd61c17c79673 (diff) | |
download | rpmtools-9118ef2b3fb1053b9a9c7f8073a8810120be9502.tar rpmtools-9118ef2b3fb1053b9a9c7f8073a8810120be9502.tar.gz rpmtools-9118ef2b3fb1053b9a9c7f8073a8810120be9502.tar.bz2 rpmtools-9118ef2b3fb1053b9a9c7f8073a8810120be9502.tar.xz rpmtools-9118ef2b3fb1053b9a9c7f8073a8810120be9502.zip |
- check data are really writen
-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; } |