diff options
author | Denis Vlasenko | 2008-06-28 05:04:09 +0000 |
---|---|---|
committer | Denis Vlasenko | 2008-06-28 05:04:09 +0000 |
commit | a60936da062fc569328cd643c460dcf215ed9966 (patch) | |
tree | f67e12d028c68c40d6ece445420cd5ab4046ff61 /archival/libunarchive/get_header_cpio.c | |
parent | 9579d87be4ab9b02195749c15a2112e2a4466ab4 (diff) | |
download | busybox-a60936da062fc569328cd643c460dcf215ed9966.zip busybox-a60936da062fc569328cd643c460dcf215ed9966.tar.gz |
libunarchive: stop using static data in archivers - archive_handle_t
can trivially provide space for that.
rpm: code shrink
tar: simplify autodetection of bz2/.gz
function old new delta
static.not_first 1 - -1
static.end 1 - -1
bb_makedev 51 49 -2
static.saved_hardlinks_created 4 - -4
static.saved_hardlinks 4 - -4
longname 4 - -4
linkname 4 - -4
hash_file 251 247 -4
get_header_tar 1528 1521 -7
rpm_main 1711 1697 -14
get_header_cpio 965 944 -21
------------------------------------------------------------------------------
(add/remove: 0/6 grow/shrink: 0/5 up/down: 0/-66) Total: -66 bytes
text data bss dec hex filename
804926 611 6868 812405 c6575 busybox_old
804878 611 6852 812341 c6535 busybox_unstripped
Diffstat (limited to 'archival/libunarchive/get_header_cpio.c')
-rw-r--r-- | archival/libunarchive/get_header_cpio.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/archival/libunarchive/get_header_cpio.c b/archival/libunarchive/get_header_cpio.c index 4ed18c6..96be4b5 100644 --- a/archival/libunarchive/get_header_cpio.c +++ b/archival/libunarchive/get_header_cpio.c @@ -19,9 +19,6 @@ typedef struct hardlinks_s { char FAST_FUNC get_header_cpio(archive_handle_t *archive_handle) { - static hardlinks_t *saved_hardlinks = NULL; - static hardlinks_t *saved_hardlinks_created = NULL; - file_header_t *file_header = archive_handle->file_header; char cpio_header[110]; char dummy[16]; @@ -29,6 +26,14 @@ char FAST_FUNC get_header_cpio(archive_handle_t *archive_handle) int major, minor, nlink, mode, inode; unsigned size, uid, gid, mtime; +#define saved_hardlinks (*(hardlinks_t **)(&archive_handle->ah_priv[0])) +#define saved_hardlinks_created (*(hardlinks_t **)(&archive_handle->ah_priv[1])) +// if (!archive_handle->ah_priv_inited) { +// archive_handle->ah_priv_inited = 1; +// saved_hardlinks = NULL; +// saved_hardlinks_created = NULL; +// } + /* There can be padding before archive header */ data_align(archive_handle, 4); |