1/* vi: set sw=4 ts=4: */
2/*
3 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
4 */
5
6#include "libbb.h"
7#include "unarchive.h"
8
9ssize_t archive_xread_all_eof(archive_handle_t *archive_handle,
10			unsigned char *buf, size_t count)
11{
12	ssize_t size;
13
14	size = full_read(archive_handle->src_fd, buf, count);
15	if (size != 0 && size != count) {
16		bb_error_msg_and_die("short read: %u of %u",
17				(unsigned)size, (unsigned)count);
18	}
19	return size;
20}
21