diff options
author | Glenn L McGrath <bug1@ihug.co.nz> | 2002-11-03 14:05:15 +0000 |
---|---|---|
committer | Glenn L McGrath <bug1@ihug.co.nz> | 2002-11-03 14:05:15 +0000 |
commit | 237ae42fc96ede945d28d9054f045b73e419d089 (patch) | |
tree | 3fb6a9c10150303aca3c218b47aaf327a186382a /archival/libunarchive/get_header_tar.c | |
parent | 2fc54a9258c3aa5dad2ce9807ba85cf29af2668e (diff) |
Abstract read and seek in unarchiving code, convert bunzip to file descriptors, support tar -j
Diffstat (limited to 'archival/libunarchive/get_header_tar.c')
-rw-r--r-- | archival/libunarchive/get_header_tar.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/archival/libunarchive/get_header_tar.c b/archival/libunarchive/get_header_tar.c index e87eb77b8..b2b9e0b03 100644 --- a/archival/libunarchive/get_header_tar.c +++ b/archival/libunarchive/get_header_tar.c @@ -50,9 +50,9 @@ extern char get_header_tar(archive_handle_t *archive_handle) char *tmp; /* Align header */ - archive_handle->offset += data_align(archive_handle->src_fd, archive_handle->offset, 512); + data_align(archive_handle, 512); - if (xread_all_eof(archive_handle->src_fd, tar.raw, 512) == 0) { + if (archive_xread_all_eof(archive_handle, tar.raw, 512) == 0) { /* End of file */ return(EXIT_FAILURE); } @@ -72,7 +72,6 @@ extern char get_header_tar(archive_handle_t *archive_handle) #endif error_msg_and_die("Invalid tar magic"); } - /* Do checksum on headers */ for (i = 0; i < 148 ; i++) { sum += tar.raw[i]; @@ -138,7 +137,7 @@ extern char get_header_tar(archive_handle_t *archive_handle) char *longname; longname = xmalloc(file_header->size + 1); - xread_all(archive_handle->src_fd, longname, file_header->size); + archive_xread_all(archive_handle, longname, file_header->size); longname[file_header->size] = '\0'; archive_handle->offset += file_header->size; @@ -150,7 +149,7 @@ extern char get_header_tar(archive_handle_t *archive_handle) char *linkname; linkname = xmalloc(file_header->size + 1); - xread_all(archive_handle->src_fd, linkname, file_header->size); + archive_xread_all(archive_handle, linkname, file_header->size); linkname[file_header->size] = '\0'; archive_handle->offset += file_header->size; |