diff options
author | Rob Landley | 2006-07-16 08:14:35 +0000 |
---|---|---|
committer | Rob Landley | 2006-07-16 08:14:35 +0000 |
commit | 534374755d618c9c36c9940c82756241c4b25a67 (patch) | |
tree | fac906b4fa40a68c53cecf20215a7a25b3b1cab6 /archival/libunarchive/decompress_unzip.c | |
parent | afb94ecf2bb6c53ce2a381d6ce45a426243c76d9 (diff) | |
download | busybox-534374755d618c9c36c9940c82756241c4b25a67.zip busybox-534374755d618c9c36c9940c82756241c4b25a67.tar.gz |
Cleaup read() and write() variants, plus a couple of new functions like
xlseek and fdlength() for the new mkswap.
Diffstat (limited to 'archival/libunarchive/decompress_unzip.c')
-rw-r--r-- | archival/libunarchive/decompress_unzip.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/archival/libunarchive/decompress_unzip.c b/archival/libunarchive/decompress_unzip.c index 46a2693..8f33e6e 100644 --- a/archival/libunarchive/decompress_unzip.c +++ b/archival/libunarchive/decompress_unzip.c @@ -116,9 +116,8 @@ static unsigned int fill_bitbuffer(unsigned int bitbuffer, unsigned int *current /* Leave the first 4 bytes empty so we can always unwind the bitbuffer * to the front of the bytebuffer, leave 4 bytes free at end of tail * so we can easily top up buffer in check_trailer_gzip() */ - if (!(bytebuffer_size = bb_xread(gunzip_src_fd, &bytebuffer[4], bytebuffer_max - 8))) { + if (1 > (bytebuffer_size = safe_read(gunzip_src_fd, &bytebuffer[4], bytebuffer_max - 8))) bb_error_msg_and_die("unexpected end of file"); - } bytebuffer_size += 4; bytebuffer_offset = 4; } @@ -862,7 +861,7 @@ int inflate_unzip(int in, int out) while(1) { int ret = inflate_get_next_window(); - nwrote = bb_full_write(out, gunzip_window, gunzip_outbuf_count); + nwrote = full_write(out, gunzip_window, gunzip_outbuf_count); if (nwrote == -1) { bb_perror_msg("write"); return -1; @@ -896,7 +895,7 @@ int inflate_gunzip(int in, int out) /* top up the input buffer with the rest of the trailer */ count = bytebuffer_size - bytebuffer_offset; if (count < 8) { - bb_xread_all(in, &bytebuffer[bytebuffer_size], 8 - count); + xread(in, &bytebuffer[bytebuffer_size], 8 - count); bytebuffer_size += 8 - count; } for (count = 0; count != 4; count++) { |