"Robert P. J. Day" | 63fc1a9 | 2006-07-02 19:47:05 +0000 | [diff] [blame] | 1 | /* vi: set sw=4 ts=4: */ |
Glenn L McGrath | 95ebf61 | 2001-10-25 14:18:08 +0000 | [diff] [blame] | 2 | /* |
"Robert P. J. Day" | 801ab14 | 2006-07-12 07:56:04 +0000 | [diff] [blame] | 3 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. |
Glenn L McGrath | 95ebf61 | 2001-10-25 14:18:08 +0000 | [diff] [blame] | 4 | */ |
| 5 | |
Glenn L McGrath | 7ca04f3 | 2002-09-25 02:47:48 +0000 | [diff] [blame] | 6 | #include "unarchive.h" |
| 7 | #include "libbb.h" |
Glenn L McGrath | 95ebf61 | 2001-10-25 14:18:08 +0000 | [diff] [blame] | 8 | |
Denis Vlasenko | 9229794 | 2006-11-21 11:58:14 +0000 | [diff] [blame] | 9 | ssize_t archive_xread_all_eof(archive_handle_t *archive_handle, |
| 10 | unsigned char *buf, size_t count) |
Glenn L McGrath | 95ebf61 | 2001-10-25 14:18:08 +0000 | [diff] [blame] | 11 | { |
Glenn L McGrath | 237ae42 | 2002-11-03 14:05:15 +0000 | [diff] [blame] | 12 | ssize_t size; |
| 13 | |
Rob Landley | 5343747 | 2006-07-16 08:14:35 +0000 | [diff] [blame] | 14 | size = full_read(archive_handle->src_fd, buf, count); |
Denis Vlasenko | 9229794 | 2006-11-21 11:58:14 +0000 | [diff] [blame] | 15 | if (size != 0 && size != count) { |
| 16 | bb_error_msg_and_die("short read: %u of %u", |
| 17 | (unsigned)size, (unsigned)count); |
Glenn L McGrath | 95ebf61 | 2001-10-25 14:18:08 +0000 | [diff] [blame] | 18 | } |
Denis Vlasenko | 9229794 | 2006-11-21 11:58:14 +0000 | [diff] [blame] | 19 | return size; |
Eric Andersen | 2276d83 | 2002-07-11 11:11:56 +0000 | [diff] [blame] | 20 | } |