From 984b0a613aaf1cdf48c2e2af08c8466a7bad8307 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Mon, 20 Jun 2016 11:06:42 +0200 Subject: libarchive: fix xmalloc_open_zipped_read_close() on NOMMU The somewhat new "unpack in memory" code was broken for xmalloc_open_zipped_read_close() on NOMMU: we seek back over signature, but then expect it to be already consumed. Stop seeking back in this case. Signed-off-by: Denys Vlasenko --- include/bb_archive.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/bb_archive.h b/include/bb_archive.h index 10969b567..2b9c5f04c 100644 --- a/include/bb_archive.h +++ b/include/bb_archive.h @@ -211,7 +211,7 @@ void dealloc_bunzip(bunzip_data *bd) FAST_FUNC; /* Meaning and direction (input/output) of the fields are transformer-specific */ typedef struct transformer_state_t { - smallint check_signature; /* most often referenced member */ + smallint signature_skipped; /* most often referenced member */ IF_DESKTOP(long long) int FAST_FUNC (*xformer)(struct transformer_state_t *xstate); USE_FOR_NOMMU(const char *xformer_prog;) @@ -252,11 +252,11 @@ int bbunpack(char **argv, void check_errors_in_children(int signo); #if BB_MMU void fork_transformer(int fd, - int check_signature, + int signature_skipped, IF_DESKTOP(long long) int FAST_FUNC (*transformer)(transformer_state_t *xstate) ) FAST_FUNC; -#define fork_transformer_with_sig(fd, transformer, transform_prog) fork_transformer((fd), 1, (transformer)) -#define fork_transformer_with_no_sig(fd, transformer) fork_transformer((fd), 0, (transformer)) +#define fork_transformer_with_sig(fd, transformer, transform_prog) fork_transformer((fd), 0, (transformer)) +#define fork_transformer_with_no_sig(fd, transformer) fork_transformer((fd), 1, (transformer)) #else void fork_transformer(int fd, const char *transform_prog) FAST_FUNC; #define fork_transformer_with_sig(fd, transformer, transform_prog) fork_transformer((fd), (transform_prog)) -- cgit v1.2.3