diff options
| author | Denys Vlasenko <vda.linux@googlemail.com> | 2025-04-20 23:43:19 +0200 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2025-04-20 23:49:33 +0200 |
| commit | c61fdadf974205104f6690ad360117bdf86f0ba6 (patch) | |
| tree | e0dace986e6b3dd538f083795ac206c23645f757 /include | |
| parent | 636315ccb9b9e7e6cb040a9626282b7892b20df3 (diff) | |
| download | busybox-w32-c61fdadf974205104f6690ad360117bdf86f0ba6.tar.gz busybox-w32-c61fdadf974205104f6690ad360117bdf86f0ba6.tar.bz2 busybox-w32-c61fdadf974205104f6690ad360117bdf86f0ba6.zip | |
libbb/archival: make setup_unzip_on_fd() return bytes read if not compressed
setup_unzip_on_fd() does not return the transformer structure, so the user
does not know how much to seek back (or alternatively what the signature was)
when compressor signature is not detected.
Currently not needed (the only user is tar which dies anyway).
However, rpm2cpio may need this if we extend it to extract the internal .cpio
even if cpio's compressions algo is not known.
function old new delta
setup_unzip_on_fd 53 59 +6
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/libbb.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/libbb.h b/include/libbb.h index 4d6193795..558f3c627 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
| @@ -1011,13 +1011,13 @@ unsigned bb_clk_tck(void) FAST_FUNC; | |||
| 1011 | 1011 | ||
| 1012 | #if SEAMLESS_COMPRESSION | 1012 | #if SEAMLESS_COMPRESSION |
| 1013 | /* Autodetects gzip/bzip2 formats. fd may be in the middle of the file! */ | 1013 | /* Autodetects gzip/bzip2 formats. fd may be in the middle of the file! */ |
| 1014 | int setup_unzip_on_fd(int fd, int fail_if_not_compressed) FAST_FUNC; | 1014 | int setup_unzip_on_fd(int fd, int die_if_not_compressed) FAST_FUNC; |
| 1015 | /* Autodetects .gz etc */ | 1015 | /* Autodetects .gz etc */ |
| 1016 | extern int open_zipped(const char *fname, int fail_if_not_compressed) FAST_FUNC; | 1016 | extern int open_zipped(const char *fname, int die_if_not_compressed) FAST_FUNC; |
| 1017 | extern void *xmalloc_open_zipped_read_close(const char *fname, size_t *maxsz_p) FAST_FUNC RETURNS_MALLOC; | 1017 | extern void *xmalloc_open_zipped_read_close(const char *fname, size_t *maxsz_p) FAST_FUNC RETURNS_MALLOC; |
| 1018 | #else | 1018 | #else |
| 1019 | # define setup_unzip_on_fd(...) (0) | 1019 | # define setup_unzip_on_fd(...) (0) |
| 1020 | # define open_zipped(fname, fail_if_not_compressed) open((fname), O_RDONLY); | 1020 | # define open_zipped(fname, die_if_not_compressed) open((fname), O_RDONLY); |
| 1021 | # define xmalloc_open_zipped_read_close(fname, maxsz_p) xmalloc_open_read_close((fname), (maxsz_p)) | 1021 | # define xmalloc_open_zipped_read_close(fname, maxsz_p) xmalloc_open_read_close((fname), (maxsz_p)) |
| 1022 | #endif | 1022 | #endif |
| 1023 | /* lzma has no signature, need a little helper. NB: exist only for ENABLE_FEATURE_SEAMLESS_LZMA=y */ | 1023 | /* lzma has no signature, need a little helper. NB: exist only for ENABLE_FEATURE_SEAMLESS_LZMA=y */ |
