"Robert P. J. Day" | 63fc1a9 | 2006-07-02 19:47:05 +0000 | [diff] [blame] | 1 | /* vi: set sw=4 ts=4: */ |
Glenn L McGrath | 7ca04f3 | 2002-09-25 02:47:48 +0000 | [diff] [blame] | 2 | /* |
Bernhard Reutner-Fischer | fa939aa | 2006-04-05 16:21:37 +0000 | [diff] [blame] | 3 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. |
Glenn L McGrath | 7ca04f3 | 2002-09-25 02:47:48 +0000 | [diff] [blame] | 4 | */ |
Denis Vlasenko | 9a7d38f | 2007-05-31 22:42:12 +0000 | [diff] [blame] | 5 | |
Bernhard Reutner-Fischer | fa939aa | 2006-04-05 16:21:37 +0000 | [diff] [blame] | 6 | #include "libbb.h" |
Denis Vlasenko | 9a7d38f | 2007-05-31 22:42:12 +0000 | [diff] [blame] | 7 | #include "unarchive.h" |
Alexander Shishkin | 535584c | 2010-03-15 15:38:09 +0100 | [diff] [blame^] | 8 | #include "ar.h" |
Glenn L McGrath | 7ca04f3 | 2002-09-25 02:47:48 +0000 | [diff] [blame] | 9 | |
Denis Vlasenko | defc1ea | 2008-06-27 02:52:20 +0000 | [diff] [blame] | 10 | void FAST_FUNC unpack_ar_archive(archive_handle_t *ar_archive) |
Glenn L McGrath | 7ca04f3 | 2002-09-25 02:47:48 +0000 | [diff] [blame] | 11 | { |
| 12 | char magic[7]; |
| 13 | |
Alexander Shishkin | 535584c | 2010-03-15 15:38:09 +0100 | [diff] [blame^] | 14 | xread(ar_archive->src_fd, magic, AR_MAGIC_LEN); |
| 15 | if (strncmp(magic, AR_MAGIC, AR_MAGIC_LEN) != 0) { |
Denis Vlasenko | e1a0d48 | 2006-10-20 13:28:22 +0000 | [diff] [blame] | 16 | bb_error_msg_and_die("invalid ar magic"); |
Glenn L McGrath | 7ca04f3 | 2002-09-25 02:47:48 +0000 | [diff] [blame] | 17 | } |
Alexander Shishkin | 535584c | 2010-03-15 15:38:09 +0100 | [diff] [blame^] | 18 | ar_archive->offset += AR_MAGIC_LEN; |
Glenn L McGrath | 7ca04f3 | 2002-09-25 02:47:48 +0000 | [diff] [blame] | 19 | |
Denis Vlasenko | 0381d42 | 2008-07-10 23:06:00 +0000 | [diff] [blame] | 20 | while (get_header_ar(ar_archive) == EXIT_SUCCESS) |
| 21 | continue; |
Glenn L McGrath | 7ca04f3 | 2002-09-25 02:47:48 +0000 | [diff] [blame] | 22 | } |