summaryrefslogtreecommitdiff
path: root/archival/libunarchive/get_header_tar.c
diff options
context:
space:
mode:
authorRob Landley2006-07-16 08:14:35 +0000
committerRob Landley2006-07-16 08:14:35 +0000
commit534374755d618c9c36c9940c82756241c4b25a67 (patch)
treefac906b4fa40a68c53cecf20215a7a25b3b1cab6 /archival/libunarchive/get_header_tar.c
parentafb94ecf2bb6c53ce2a381d6ce45a426243c76d9 (diff)
downloadbusybox-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/get_header_tar.c')
-rw-r--r--archival/libunarchive/get_header_tar.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/archival/libunarchive/get_header_tar.c b/archival/libunarchive/get_header_tar.c
index 1cbde95..4394d23 100644
--- a/archival/libunarchive/get_header_tar.c
+++ b/archival/libunarchive/get_header_tar.c
@@ -56,11 +56,7 @@ char get_header_tar(archive_handle_t *archive_handle)
/* Align header */
data_align(archive_handle, 512);
- if (bb_full_read(archive_handle->src_fd, tar.raw, 512) != 512) {
- /* Assume end of file */
- bb_error_msg_and_die("Short header");
- //return(EXIT_FAILURE);
- }
+ xread(archive_handle->src_fd, tar.raw, 512);
archive_handle->offset += 512;
/* If there is no filename its an empty header */
@@ -69,7 +65,7 @@ char get_header_tar(archive_handle_t *archive_handle)
/* This is the second consecutive empty header! End of archive!
* Read until the end to empty the pipe from gz or bz2
*/
- while (bb_full_read(archive_handle->src_fd, tar.raw, 512) == 512);
+ while (full_read(archive_handle->src_fd, tar.raw, 512) == 512);
return(EXIT_FAILURE);
}
end = 1;
@@ -166,14 +162,14 @@ char get_header_tar(archive_handle_t *archive_handle)
#ifdef CONFIG_FEATURE_TAR_GNU_EXTENSIONS
case 'L': {
longname = xzalloc(file_header->size + 1);
- archive_xread_all(archive_handle, longname, file_header->size);
+ xread(archive_handle->src_fd, longname, file_header->size);
archive_handle->offset += file_header->size;
return(get_header_tar(archive_handle));
}
case 'K': {
linkname = xzalloc(file_header->size + 1);
- archive_xread_all(archive_handle, linkname, file_header->size);
+ xread(archive_handle->src_fd, linkname, file_header->size);
archive_handle->offset += file_header->size;
file_header->name = linkname;