aboutsummaryrefslogtreecommitdiff
path: root/archival
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2009-04-21 11:09:40 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2009-04-21 11:09:40 +0000
commit5e34ff29bcc870936ab18172f438a34d042d4e03 (patch)
treea5e7a528f2f916eb883f1161eadceacdf2dca4be /archival
parent8b814b4a349e2262c0ad25793b05206a14651ebb (diff)
downloadbusybox-w32-5e34ff29bcc870936ab18172f438a34d042d4e03.tar.gz
busybox-w32-5e34ff29bcc870936ab18172f438a34d042d4e03.tar.bz2
busybox-w32-5e34ff29bcc870936ab18172f438a34d042d4e03.zip
*: mass renaming of USE_XXXX to IF_XXXX
and SKIP_XXXX to IF_NOT_XXXX - the second one was especially badly named. It was not skipping anything!
Diffstat (limited to 'archival')
-rw-r--r--archival/bbunzip.c16
-rw-r--r--archival/bzip2.c10
-rw-r--r--archival/cpio.c4
-rw-r--r--archival/gzip.c4
-rw-r--r--archival/libunarchive/decompress_bunzip2.c10
-rw-r--r--archival/libunarchive/decompress_uncompress.c12
-rw-r--r--archival/libunarchive/decompress_unlzma.c16
-rw-r--r--archival/libunarchive/decompress_unzip.c16
-rw-r--r--archival/libunarchive/get_header_tar.c12
-rw-r--r--archival/libunarchive/open_transformer.c2
-rw-r--r--archival/rpm.c4
-rw-r--r--archival/tar.c54
12 files changed, 80 insertions, 80 deletions
diff --git a/archival/bbunzip.c b/archival/bbunzip.c
index 75489f2a5..d25f50939 100644
--- a/archival/bbunzip.c
+++ b/archival/bbunzip.c
@@ -30,11 +30,11 @@ int open_to_or_warn(int to_fd, const char *filename, int flags, int mode)
30 30
31int FAST_FUNC bbunpack(char **argv, 31int FAST_FUNC bbunpack(char **argv,
32 char* (*make_new_name)(char *filename), 32 char* (*make_new_name)(char *filename),
33 USE_DESKTOP(long long) int (*unpacker)(unpack_info_t *info) 33 IF_DESKTOP(long long) int (*unpacker)(unpack_info_t *info)
34) 34)
35{ 35{
36 struct stat stat_buf; 36 struct stat stat_buf;
37 USE_DESKTOP(long long) int status; 37 IF_DESKTOP(long long) int status;
38 char *filename, *new_name; 38 char *filename, *new_name;
39 smallint exitcode = 0; 39 smallint exitcode = 0;
40 unpack_info_t info; 40 unpack_info_t info;
@@ -175,7 +175,7 @@ char* make_new_name_bunzip2(char *filename)
175} 175}
176 176
177static 177static
178USE_DESKTOP(long long) int unpack_bunzip2(unpack_info_t *info UNUSED_PARAM) 178IF_DESKTOP(long long) int unpack_bunzip2(unpack_info_t *info UNUSED_PARAM)
179{ 179{
180 return unpack_bz2_stream_prime(STDIN_FILENO, STDOUT_FILENO); 180 return unpack_bz2_stream_prime(STDIN_FILENO, STDOUT_FILENO);
181} 181}
@@ -251,9 +251,9 @@ char* make_new_name_gunzip(char *filename)
251} 251}
252 252
253static 253static
254USE_DESKTOP(long long) int unpack_gunzip(unpack_info_t *info) 254IF_DESKTOP(long long) int unpack_gunzip(unpack_info_t *info)
255{ 255{
256 USE_DESKTOP(long long) int status = -1; 256 IF_DESKTOP(long long) int status = -1;
257 257
258 /* do the decompression, and cleanup */ 258 /* do the decompression, and cleanup */
259 if (xread_char(STDIN_FILENO) == 0x1f) { 259 if (xread_char(STDIN_FILENO) == 0x1f) {
@@ -325,7 +325,7 @@ char* make_new_name_unlzma(char *filename)
325} 325}
326 326
327static 327static
328USE_DESKTOP(long long) int unpack_unlzma(unpack_info_t *info UNUSED_PARAM) 328IF_DESKTOP(long long) int unpack_unlzma(unpack_info_t *info UNUSED_PARAM)
329{ 329{
330 return unpack_lzma_stream(STDIN_FILENO, STDOUT_FILENO); 330 return unpack_lzma_stream(STDIN_FILENO, STDOUT_FILENO);
331} 331}
@@ -360,9 +360,9 @@ char* make_new_name_uncompress(char *filename)
360} 360}
361 361
362static 362static
363USE_DESKTOP(long long) int unpack_uncompress(unpack_info_t *info UNUSED_PARAM) 363IF_DESKTOP(long long) int unpack_uncompress(unpack_info_t *info UNUSED_PARAM)
364{ 364{
365 USE_DESKTOP(long long) int status = -1; 365 IF_DESKTOP(long long) int status = -1;
366 366
367 if ((xread_char(STDIN_FILENO) != 0x1f) || (xread_char(STDIN_FILENO) != 0x9d)) { 367 if ((xread_char(STDIN_FILENO) != 0x1f) || (xread_char(STDIN_FILENO) != 0x9d)) {
368 bb_error_msg("invalid magic"); 368 bb_error_msg("invalid magic");
diff --git a/archival/bzip2.c b/archival/bzip2.c
index 8eb5ca9ae..bbaf56669 100644
--- a/archival/bzip2.c
+++ b/archival/bzip2.c
@@ -64,7 +64,7 @@ static uint8_t level;
64 * total written bytes so far otherwise 64 * total written bytes so far otherwise
65 */ 65 */
66static 66static
67USE_DESKTOP(long long) int bz_write(bz_stream *strm, void* rbuf, ssize_t rlen, void *wbuf) 67IF_DESKTOP(long long) int bz_write(bz_stream *strm, void* rbuf, ssize_t rlen, void *wbuf)
68{ 68{
69 int n, n2, ret; 69 int n, n2, ret;
70 70
@@ -98,13 +98,13 @@ USE_DESKTOP(long long) int bz_write(bz_stream *strm, void* rbuf, ssize_t rlen, v
98 if (rlen && strm->avail_in == 0) 98 if (rlen && strm->avail_in == 0)
99 break; 99 break;
100 } 100 }
101 return 0 USE_DESKTOP( + strm->total_out ); 101 return 0 IF_DESKTOP( + strm->total_out );
102} 102}
103 103
104static 104static
105USE_DESKTOP(long long) int compressStream(unpack_info_t *info UNUSED_PARAM) 105IF_DESKTOP(long long) int compressStream(unpack_info_t *info UNUSED_PARAM)
106{ 106{
107 USE_DESKTOP(long long) int total; 107 IF_DESKTOP(long long) int total;
108 ssize_t count; 108 ssize_t count;
109 bz_stream bzs; /* it's small */ 109 bz_stream bzs; /* it's small */
110#define strm (&bzs) 110#define strm (&bzs)
@@ -163,7 +163,7 @@ int bzip2_main(int argc UNUSED_PARAM, char **argv)
163 163
164 opt_complementary = "s2"; /* -s means -2 (compatibility) */ 164 opt_complementary = "s2"; /* -s means -2 (compatibility) */
165 /* Must match bbunzip's constants OPT_STDOUT, OPT_FORCE! */ 165 /* Must match bbunzip's constants OPT_STDOUT, OPT_FORCE! */
166 opt = getopt32(argv, "cfv" USE_BUNZIP2("dt") "123456789qzs"); 166 opt = getopt32(argv, "cfv" IF_BUNZIP2("dt") "123456789qzs");
167#if ENABLE_BUNZIP2 /* bunzip2_main may not be visible... */ 167#if ENABLE_BUNZIP2 /* bunzip2_main may not be visible... */
168 if (opt & 0x18) // -d and/or -t 168 if (opt & 0x18) // -d and/or -t
169 return bunzip2_main(argc, argv); 169 return bunzip2_main(argc, argv);
diff --git a/archival/cpio.c b/archival/cpio.c
index 11b22e478..4cf3c2c50 100644
--- a/archival/cpio.c
+++ b/archival/cpio.c
@@ -270,7 +270,7 @@ int cpio_main(int argc UNUSED_PARAM, char **argv)
270{ 270{
271 archive_handle_t *archive_handle; 271 archive_handle_t *archive_handle;
272 char *cpio_filename; 272 char *cpio_filename;
273 USE_FEATURE_CPIO_O(const char *cpio_fmt = "";) 273 IF_FEATURE_CPIO_O(const char *cpio_fmt = "";)
274 unsigned opt; 274 unsigned opt;
275 275
276#if ENABLE_GETOPT_LONG 276#if ENABLE_GETOPT_LONG
@@ -295,7 +295,7 @@ int cpio_main(int argc UNUSED_PARAM, char **argv)
295#if !ENABLE_FEATURE_CPIO_O 295#if !ENABLE_FEATURE_CPIO_O
296 opt = getopt32(argv, OPTION_STR, &cpio_filename); 296 opt = getopt32(argv, OPTION_STR, &cpio_filename);
297#else 297#else
298 opt = getopt32(argv, OPTION_STR "oH:" USE_FEATURE_CPIO_P("p"), &cpio_filename, &cpio_fmt); 298 opt = getopt32(argv, OPTION_STR "oH:" IF_FEATURE_CPIO_P("p"), &cpio_filename, &cpio_fmt);
299 if (opt & CPIO_OPT_PASSTHROUGH) { 299 if (opt & CPIO_OPT_PASSTHROUGH) {
300 pid_t pid; 300 pid_t pid;
301 struct fd_pair pp; 301 struct fd_pair pp;
diff --git a/archival/gzip.c b/archival/gzip.c
index 43804b2e4..a8f8fa4a5 100644
--- a/archival/gzip.c
+++ b/archival/gzip.c
@@ -2015,7 +2015,7 @@ char* make_new_name_gzip(char *filename)
2015} 2015}
2016 2016
2017static 2017static
2018USE_DESKTOP(long long) int pack_gzip(unpack_info_t *info UNUSED_PARAM) 2018IF_DESKTOP(long long) int pack_gzip(unpack_info_t *info UNUSED_PARAM)
2019{ 2019{
2020 struct stat s; 2020 struct stat s;
2021 2021
@@ -2050,7 +2050,7 @@ int gzip_main(int argc UNUSED_PARAM, char **argv)
2050 unsigned opt; 2050 unsigned opt;
2051 2051
2052 /* Must match bbunzip's constants OPT_STDOUT, OPT_FORCE! */ 2052 /* Must match bbunzip's constants OPT_STDOUT, OPT_FORCE! */
2053 opt = getopt32(argv, "cfv" USE_GUNZIP("dt") "q123456789n"); 2053 opt = getopt32(argv, "cfv" IF_GUNZIP("dt") "q123456789n");
2054#if ENABLE_GUNZIP /* gunzip_main may not be visible... */ 2054#if ENABLE_GUNZIP /* gunzip_main may not be visible... */
2055 if (opt & 0x18) // -d and/or -t 2055 if (opt & 0x18) // -d and/or -t
2056 return gunzip_main(argc, argv); 2056 return gunzip_main(argc, argv);
diff --git a/archival/libunarchive/decompress_bunzip2.c b/archival/libunarchive/decompress_bunzip2.c
index b53720f23..cd8df086e 100644
--- a/archival/libunarchive/decompress_bunzip2.c
+++ b/archival/libunarchive/decompress_bunzip2.c
@@ -648,10 +648,10 @@ void FAST_FUNC dealloc_bunzip(bunzip_data *bd)
648 648
649 649
650/* Decompress src_fd to dst_fd. Stops at end of bzip data, not end of file. */ 650/* Decompress src_fd to dst_fd. Stops at end of bzip data, not end of file. */
651USE_DESKTOP(long long) int FAST_FUNC 651IF_DESKTOP(long long) int FAST_FUNC
652unpack_bz2_stream(int src_fd, int dst_fd) 652unpack_bz2_stream(int src_fd, int dst_fd)
653{ 653{
654 USE_DESKTOP(long long total_written = 0;) 654 IF_DESKTOP(long long total_written = 0;)
655 char *outbuf; 655 char *outbuf;
656 bunzip_data *bd; 656 bunzip_data *bd;
657 int i; 657 int i;
@@ -666,7 +666,7 @@ unpack_bz2_stream(int src_fd, int dst_fd)
666 i = RETVAL_SHORT_WRITE; 666 i = RETVAL_SHORT_WRITE;
667 break; 667 break;
668 } 668 }
669 USE_DESKTOP(total_written += i;) 669 IF_DESKTOP(total_written += i;)
670 } 670 }
671 } 671 }
672 672
@@ -686,10 +686,10 @@ unpack_bz2_stream(int src_fd, int dst_fd)
686 dealloc_bunzip(bd); 686 dealloc_bunzip(bd);
687 free(outbuf); 687 free(outbuf);
688 688
689 return i ? i : USE_DESKTOP(total_written) + 0; 689 return i ? i : IF_DESKTOP(total_written) + 0;
690} 690}
691 691
692USE_DESKTOP(long long) int FAST_FUNC 692IF_DESKTOP(long long) int FAST_FUNC
693unpack_bz2_stream_prime(int src_fd, int dst_fd) 693unpack_bz2_stream_prime(int src_fd, int dst_fd)
694{ 694{
695 unsigned char magic[2]; 695 unsigned char magic[2];
diff --git a/archival/libunarchive/decompress_uncompress.c b/archival/libunarchive/decompress_uncompress.c
index fe1491e71..2877c8981 100644
--- a/archival/libunarchive/decompress_uncompress.c
+++ b/archival/libunarchive/decompress_uncompress.c
@@ -72,11 +72,11 @@
72 * be stored in the compressed file. 72 * be stored in the compressed file.
73 */ 73 */
74 74
75USE_DESKTOP(long long) int FAST_FUNC 75IF_DESKTOP(long long) int FAST_FUNC
76unpack_Z_stream(int fd_in, int fd_out) 76unpack_Z_stream(int fd_in, int fd_out)
77{ 77{
78 USE_DESKTOP(long long total_written = 0;) 78 IF_DESKTOP(long long total_written = 0;)
79 USE_DESKTOP(long long) int retval = -1; 79 IF_DESKTOP(long long) int retval = -1;
80 unsigned char *stackp; 80 unsigned char *stackp;
81 long code; 81 long code;
82 int finchar; 82 int finchar;
@@ -265,7 +265,7 @@ unpack_Z_stream(int fd_in, int fd_out)
265 if (outpos >= OBUFSIZ) { 265 if (outpos >= OBUFSIZ) {
266 full_write(fd_out, outbuf, outpos); 266 full_write(fd_out, outbuf, outpos);
267//error check?? 267//error check??
268 USE_DESKTOP(total_written += outpos;) 268 IF_DESKTOP(total_written += outpos;)
269 outpos = 0; 269 outpos = 0;
270 } 270 }
271 stackp += i; 271 stackp += i;
@@ -294,10 +294,10 @@ unpack_Z_stream(int fd_in, int fd_out)
294 if (outpos > 0) { 294 if (outpos > 0) {
295 full_write(fd_out, outbuf, outpos); 295 full_write(fd_out, outbuf, outpos);
296//error check?? 296//error check??
297 USE_DESKTOP(total_written += outpos;) 297 IF_DESKTOP(total_written += outpos;)
298 } 298 }
299 299
300 retval = USE_DESKTOP(total_written) + 0; 300 retval = IF_DESKTOP(total_written) + 0;
301 err: 301 err:
302 free(inbuf); 302 free(inbuf);
303 free(outbuf); 303 free(outbuf);
diff --git a/archival/libunarchive/decompress_unlzma.c b/archival/libunarchive/decompress_unlzma.c
index 2cfcd9b7d..33e5cd65d 100644
--- a/archival/libunarchive/decompress_unlzma.c
+++ b/archival/libunarchive/decompress_unlzma.c
@@ -228,10 +228,10 @@ enum {
228}; 228};
229 229
230 230
231USE_DESKTOP(long long) int FAST_FUNC 231IF_DESKTOP(long long) int FAST_FUNC
232unpack_lzma_stream(int src_fd, int dst_fd) 232unpack_lzma_stream(int src_fd, int dst_fd)
233{ 233{
234 USE_DESKTOP(long long total_written = 0;) 234 IF_DESKTOP(long long total_written = 0;)
235 lzma_header_t header; 235 lzma_header_t header;
236 int lc, pb, lp; 236 int lc, pb, lp;
237 uint32_t pos_state_mask; 237 uint32_t pos_state_mask;
@@ -330,7 +330,7 @@ unpack_lzma_stream(int src_fd, int dst_fd)
330 global_pos += header.dict_size; 330 global_pos += header.dict_size;
331 if (full_write(dst_fd, buffer, header.dict_size) != (ssize_t)header.dict_size) 331 if (full_write(dst_fd, buffer, header.dict_size) != (ssize_t)header.dict_size)
332 goto bad; 332 goto bad;
333 USE_DESKTOP(total_written += header.dict_size;) 333 IF_DESKTOP(total_written += header.dict_size;)
334 } 334 }
335#else 335#else
336 len = 1; 336 len = 1;
@@ -468,20 +468,20 @@ unpack_lzma_stream(int src_fd, int dst_fd)
468 } 468 }
469 469
470 len += LZMA_MATCH_MIN_LEN; 470 len += LZMA_MATCH_MIN_LEN;
471 SKIP_FEATURE_LZMA_FAST(string:) 471 IF_NOT_FEATURE_LZMA_FAST(string:)
472 do { 472 do {
473 pos = buffer_pos - rep0; 473 pos = buffer_pos - rep0;
474 while (pos >= header.dict_size) 474 while (pos >= header.dict_size)
475 pos += header.dict_size; 475 pos += header.dict_size;
476 previous_byte = buffer[pos]; 476 previous_byte = buffer[pos];
477 SKIP_FEATURE_LZMA_FAST(one_byte2:) 477 IF_NOT_FEATURE_LZMA_FAST(one_byte2:)
478 buffer[buffer_pos++] = previous_byte; 478 buffer[buffer_pos++] = previous_byte;
479 if (buffer_pos == header.dict_size) { 479 if (buffer_pos == header.dict_size) {
480 buffer_pos = 0; 480 buffer_pos = 0;
481 global_pos += header.dict_size; 481 global_pos += header.dict_size;
482 if (full_write(dst_fd, buffer, header.dict_size) != (ssize_t)header.dict_size) 482 if (full_write(dst_fd, buffer, header.dict_size) != (ssize_t)header.dict_size)
483 goto bad; 483 goto bad;
484 USE_DESKTOP(total_written += header.dict_size;) 484 IF_DESKTOP(total_written += header.dict_size;)
485 } 485 }
486 len--; 486 len--;
487 } while (len != 0 && buffer_pos < header.dst_size); 487 } while (len != 0 && buffer_pos < header.dst_size);
@@ -489,8 +489,8 @@ unpack_lzma_stream(int src_fd, int dst_fd)
489 } 489 }
490 490
491 { 491 {
492 SKIP_DESKTOP(int total_written = 0; /* success */) 492 IF_NOT_DESKTOP(int total_written = 0; /* success */)
493 USE_DESKTOP(total_written += buffer_pos;) 493 IF_DESKTOP(total_written += buffer_pos;)
494 if (full_write(dst_fd, buffer, buffer_pos) != (ssize_t)buffer_pos) { 494 if (full_write(dst_fd, buffer, buffer_pos) != (ssize_t)buffer_pos) {
495 bad: 495 bad:
496 total_written = -1; /* failure */ 496 total_written = -1; /* failure */
diff --git a/archival/libunarchive/decompress_unzip.c b/archival/libunarchive/decompress_unzip.c
index 86969251e..b090f26eb 100644
--- a/archival/libunarchive/decompress_unzip.c
+++ b/archival/libunarchive/decompress_unzip.c
@@ -970,10 +970,10 @@ static int inflate_get_next_window(STATE_PARAM_ONLY)
970 970
971 971
972/* Called from unpack_gz_stream() and inflate_unzip() */ 972/* Called from unpack_gz_stream() and inflate_unzip() */
973static USE_DESKTOP(long long) int 973static IF_DESKTOP(long long) int
974inflate_unzip_internal(STATE_PARAM int in, int out) 974inflate_unzip_internal(STATE_PARAM int in, int out)
975{ 975{
976 USE_DESKTOP(long long) int n = 0; 976 IF_DESKTOP(long long) int n = 0;
977 ssize_t nwrote; 977 ssize_t nwrote;
978 978
979 /* Allocate all global buffers (for DYN_ALLOC option) */ 979 /* Allocate all global buffers (for DYN_ALLOC option) */
@@ -1008,7 +1008,7 @@ inflate_unzip_internal(STATE_PARAM int in, int out)
1008 n = -1; 1008 n = -1;
1009 goto ret; 1009 goto ret;
1010 } 1010 }
1011 USE_DESKTOP(n += nwrote;) 1011 IF_DESKTOP(n += nwrote;)
1012 if (r == 0) break; 1012 if (r == 0) break;
1013 } 1013 }
1014 1014
@@ -1033,10 +1033,10 @@ inflate_unzip_internal(STATE_PARAM int in, int out)
1033 1033
1034/* For unzip */ 1034/* For unzip */
1035 1035
1036USE_DESKTOP(long long) int FAST_FUNC 1036IF_DESKTOP(long long) int FAST_FUNC
1037inflate_unzip(inflate_unzip_result *res, off_t compr_size, int in, int out) 1037inflate_unzip(inflate_unzip_result *res, off_t compr_size, int in, int out)
1038{ 1038{
1039 USE_DESKTOP(long long) int n; 1039 IF_DESKTOP(long long) int n;
1040 DECLARE_STATE; 1040 DECLARE_STATE;
1041 1041
1042 ALLOC_STATE; 1042 ALLOC_STATE;
@@ -1181,11 +1181,11 @@ static int check_header_gzip(STATE_PARAM unpack_info_t *info)
1181 return 1; 1181 return 1;
1182} 1182}
1183 1183
1184USE_DESKTOP(long long) int FAST_FUNC 1184IF_DESKTOP(long long) int FAST_FUNC
1185unpack_gz_stream_with_info(int in, int out, unpack_info_t *info) 1185unpack_gz_stream_with_info(int in, int out, unpack_info_t *info)
1186{ 1186{
1187 uint32_t v32; 1187 uint32_t v32;
1188 USE_DESKTOP(long long) int n; 1188 IF_DESKTOP(long long) int n;
1189 DECLARE_STATE; 1189 DECLARE_STATE;
1190 1190
1191 n = 0; 1191 n = 0;
@@ -1245,7 +1245,7 @@ unpack_gz_stream_with_info(int in, int out, unpack_info_t *info)
1245 return n; 1245 return n;
1246} 1246}
1247 1247
1248USE_DESKTOP(long long) int FAST_FUNC 1248IF_DESKTOP(long long) int FAST_FUNC
1249unpack_gz_stream(int in, int out) 1249unpack_gz_stream(int in, int out)
1250{ 1250{
1251 return unpack_gz_stream_with_info(in, out, NULL); 1251 return unpack_gz_stream_with_info(in, out, NULL);
diff --git a/archival/libunarchive/get_header_tar.c b/archival/libunarchive/get_header_tar.c
index 443052f7e..16e2de440 100644
--- a/archival/libunarchive/get_header_tar.c
+++ b/archival/libunarchive/get_header_tar.c
@@ -144,8 +144,8 @@ char FAST_FUNC get_header_tar(archive_handle_t *archive_handle)
144// if (!archive_handle->ah_priv_inited) { 144// if (!archive_handle->ah_priv_inited) {
145// archive_handle->ah_priv_inited = 1; 145// archive_handle->ah_priv_inited = 1;
146// p_end = 0; 146// p_end = 0;
147// USE_FEATURE_TAR_GNU_EXTENSIONS(p_longname = NULL;) 147// IF_FEATURE_TAR_GNU_EXTENSIONS(p_longname = NULL;)
148// USE_FEATURE_TAR_GNU_EXTENSIONS(p_linkname = NULL;) 148// IF_FEATURE_TAR_GNU_EXTENSIONS(p_linkname = NULL;)
149// } 149// }
150 150
151 if (sizeof(tar) != 512) 151 if (sizeof(tar) != 512)
@@ -176,7 +176,7 @@ char FAST_FUNC get_header_tar(archive_handle_t *archive_handle)
176 bb_error_msg_and_die("short read"); 176 bb_error_msg_and_die("short read");
177 } 177 }
178 if (i != 512) { 178 if (i != 512) {
179 USE_FEATURE_TAR_AUTODETECT(goto autodetect;) 179 IF_FEATURE_TAR_AUTODETECT(goto autodetect;)
180 goto short_read; 180 goto short_read;
181 } 181 }
182 182
@@ -265,14 +265,14 @@ char FAST_FUNC get_header_tar(archive_handle_t *archive_handle)
265#if ENABLE_FEATURE_TAR_OLDGNU_COMPATIBILITY 265#if ENABLE_FEATURE_TAR_OLDGNU_COMPATIBILITY
266 sum = strtoul(tar.chksum, &cp, 8); 266 sum = strtoul(tar.chksum, &cp, 8);
267 if ((*cp && *cp != ' ') 267 if ((*cp && *cp != ' ')
268 || (sum_u != sum USE_FEATURE_TAR_OLDSUN_COMPATIBILITY(&& sum_s != sum)) 268 || (sum_u != sum IF_FEATURE_TAR_OLDSUN_COMPATIBILITY(&& sum_s != sum))
269 ) { 269 ) {
270 bb_error_msg_and_die("invalid tar header checksum"); 270 bb_error_msg_and_die("invalid tar header checksum");
271 } 271 }
272#else 272#else
273 /* This field does not need special treatment (getOctal) */ 273 /* This field does not need special treatment (getOctal) */
274 sum = xstrtoul(tar.chksum, 8); 274 sum = xstrtoul(tar.chksum, 8);
275 if (sum_u != sum USE_FEATURE_TAR_OLDSUN_COMPATIBILITY(&& sum_s != sum)) { 275 if (sum_u != sum IF_FEATURE_TAR_OLDSUN_COMPATIBILITY(&& sum_s != sum)) {
276 bb_error_msg_and_die("invalid tar header checksum"); 276 bb_error_msg_and_die("invalid tar header checksum");
277 } 277 }
278#endif 278#endif
@@ -356,7 +356,7 @@ char FAST_FUNC get_header_tar(archive_handle_t *archive_handle)
356 file_header->mode |= S_IFBLK; 356 file_header->mode |= S_IFBLK;
357 goto size0; 357 goto size0;
358 case '5': 358 case '5':
359 USE_FEATURE_TAR_OLDGNU_COMPATIBILITY(set_dir:) 359 IF_FEATURE_TAR_OLDGNU_COMPATIBILITY(set_dir:)
360 file_header->mode |= S_IFDIR; 360 file_header->mode |= S_IFDIR;
361 goto size0; 361 goto size0;
362 case '6': 362 case '6':
diff --git a/archival/libunarchive/open_transformer.c b/archival/libunarchive/open_transformer.c
index 42fdd96a6..fae589ee0 100644
--- a/archival/libunarchive/open_transformer.c
+++ b/archival/libunarchive/open_transformer.c
@@ -12,7 +12,7 @@
12 * in include/unarchive.h. On NOMMU, transformer is removed. 12 * in include/unarchive.h. On NOMMU, transformer is removed.
13 */ 13 */
14void FAST_FUNC open_transformer(int fd, 14void FAST_FUNC open_transformer(int fd,
15 USE_DESKTOP(long long) int FAST_FUNC (*transformer)(int src_fd, int dst_fd), 15 IF_DESKTOP(long long) int FAST_FUNC (*transformer)(int src_fd, int dst_fd),
16 const char *transform_prog) 16 const char *transform_prog)
17{ 17{
18 struct fd_pair fd_pipe; 18 struct fd_pair fd_pipe;
diff --git a/archival/rpm.c b/archival/rpm.c
index 4c36067c4..569bcddf2 100644
--- a/archival/rpm.c
+++ b/archival/rpm.c
@@ -190,7 +190,7 @@ static void extract_cpio_gz(int fd)
190 archive_handle_t *archive_handle; 190 archive_handle_t *archive_handle;
191 unsigned char magic[2]; 191 unsigned char magic[2];
192#if BB_MMU 192#if BB_MMU
193 USE_DESKTOP(long long) int FAST_FUNC (*xformer)(int src_fd, int dst_fd); 193 IF_DESKTOP(long long) int FAST_FUNC (*xformer)(int src_fd, int dst_fd);
194 enum { xformer_prog = 0 }; 194 enum { xformer_prog = 0 };
195#else 195#else
196 enum { xformer = 0 }; 196 enum { xformer = 0 };
@@ -224,7 +224,7 @@ static void extract_cpio_gz(int fd)
224 || magic[0] != 'B' || magic[1] != 'Z' 224 || magic[0] != 'B' || magic[1] != 'Z'
225 ) { 225 ) {
226 bb_error_msg_and_die("no gzip" 226 bb_error_msg_and_die("no gzip"
227 USE_FEATURE_SEAMLESS_BZ2("/bzip2") 227 IF_FEATURE_SEAMLESS_BZ2("/bzip2")
228 " magic"); 228 " magic");
229 } 229 }
230#if BB_MMU 230#if BB_MMU
diff --git a/archival/tar.c b/archival/tar.c
index 03d66a692..379028bd9 100644
--- a/archival/tar.c
+++ b/archival/tar.c
@@ -728,14 +728,14 @@ static void handle_SIGCHLD(int status)
728 728
729enum { 729enum {
730 OPTBIT_KEEP_OLD = 7, 730 OPTBIT_KEEP_OLD = 7,
731 USE_FEATURE_TAR_CREATE( OPTBIT_CREATE ,) 731 IF_FEATURE_TAR_CREATE( OPTBIT_CREATE ,)
732 USE_FEATURE_TAR_CREATE( OPTBIT_DEREFERENCE ,) 732 IF_FEATURE_TAR_CREATE( OPTBIT_DEREFERENCE ,)
733 USE_FEATURE_SEAMLESS_BZ2( OPTBIT_BZIP2 ,) 733 IF_FEATURE_SEAMLESS_BZ2( OPTBIT_BZIP2 ,)
734 USE_FEATURE_SEAMLESS_LZMA(OPTBIT_LZMA ,) 734 IF_FEATURE_SEAMLESS_LZMA(OPTBIT_LZMA ,)
735 USE_FEATURE_TAR_FROM( OPTBIT_INCLUDE_FROM,) 735 IF_FEATURE_TAR_FROM( OPTBIT_INCLUDE_FROM,)
736 USE_FEATURE_TAR_FROM( OPTBIT_EXCLUDE_FROM,) 736 IF_FEATURE_TAR_FROM( OPTBIT_EXCLUDE_FROM,)
737 USE_FEATURE_SEAMLESS_GZ( OPTBIT_GZIP ,) 737 IF_FEATURE_SEAMLESS_GZ( OPTBIT_GZIP ,)
738 USE_FEATURE_SEAMLESS_Z( OPTBIT_COMPRESS ,) 738 IF_FEATURE_SEAMLESS_Z( OPTBIT_COMPRESS ,)
739 OPTBIT_NOPRESERVE_OWN, 739 OPTBIT_NOPRESERVE_OWN,
740 OPTBIT_NOPRESERVE_PERM, 740 OPTBIT_NOPRESERVE_PERM,
741 OPTBIT_NUMERIC_OWNER, 741 OPTBIT_NUMERIC_OWNER,
@@ -747,14 +747,14 @@ enum {
747 OPT_P = 1 << 5, // p 747 OPT_P = 1 << 5, // p
748 OPT_VERBOSE = 1 << 6, // v 748 OPT_VERBOSE = 1 << 6, // v
749 OPT_KEEP_OLD = 1 << 7, // k 749 OPT_KEEP_OLD = 1 << 7, // k
750 OPT_CREATE = USE_FEATURE_TAR_CREATE( (1 << OPTBIT_CREATE )) + 0, // c 750 OPT_CREATE = IF_FEATURE_TAR_CREATE( (1 << OPTBIT_CREATE )) + 0, // c
751 OPT_DEREFERENCE = USE_FEATURE_TAR_CREATE( (1 << OPTBIT_DEREFERENCE )) + 0, // h 751 OPT_DEREFERENCE = IF_FEATURE_TAR_CREATE( (1 << OPTBIT_DEREFERENCE )) + 0, // h
752 OPT_BZIP2 = USE_FEATURE_SEAMLESS_BZ2( (1 << OPTBIT_BZIP2 )) + 0, // j 752 OPT_BZIP2 = IF_FEATURE_SEAMLESS_BZ2( (1 << OPTBIT_BZIP2 )) + 0, // j
753 OPT_LZMA = USE_FEATURE_SEAMLESS_LZMA((1 << OPTBIT_LZMA )) + 0, // a 753 OPT_LZMA = IF_FEATURE_SEAMLESS_LZMA((1 << OPTBIT_LZMA )) + 0, // a
754 OPT_INCLUDE_FROM = USE_FEATURE_TAR_FROM( (1 << OPTBIT_INCLUDE_FROM)) + 0, // T 754 OPT_INCLUDE_FROM = IF_FEATURE_TAR_FROM( (1 << OPTBIT_INCLUDE_FROM)) + 0, // T
755 OPT_EXCLUDE_FROM = USE_FEATURE_TAR_FROM( (1 << OPTBIT_EXCLUDE_FROM)) + 0, // X 755 OPT_EXCLUDE_FROM = IF_FEATURE_TAR_FROM( (1 << OPTBIT_EXCLUDE_FROM)) + 0, // X
756 OPT_GZIP = USE_FEATURE_SEAMLESS_GZ( (1 << OPTBIT_GZIP )) + 0, // z 756 OPT_GZIP = IF_FEATURE_SEAMLESS_GZ( (1 << OPTBIT_GZIP )) + 0, // z
757 OPT_COMPRESS = USE_FEATURE_SEAMLESS_Z( (1 << OPTBIT_COMPRESS )) + 0, // Z 757 OPT_COMPRESS = IF_FEATURE_SEAMLESS_Z( (1 << OPTBIT_COMPRESS )) + 0, // Z
758 OPT_NOPRESERVE_OWN = 1 << OPTBIT_NOPRESERVE_OWN , // no-same-owner 758 OPT_NOPRESERVE_OWN = 1 << OPTBIT_NOPRESERVE_OWN , // no-same-owner
759 OPT_NOPRESERVE_PERM = 1 << OPTBIT_NOPRESERVE_PERM, // no-same-permissions 759 OPT_NOPRESERVE_PERM = 1 << OPTBIT_NOPRESERVE_PERM, // no-same-permissions
760 OPT_NUMERIC_OWNER = 1 << OPTBIT_NUMERIC_OWNER, 760 OPT_NUMERIC_OWNER = 1 << OPTBIT_NUMERIC_OWNER,
@@ -832,24 +832,24 @@ int tar_main(int argc UNUSED_PARAM, char **argv)
832#if ENABLE_FEATURE_TAR_LONG_OPTIONS && ENABLE_FEATURE_TAR_FROM 832#if ENABLE_FEATURE_TAR_LONG_OPTIONS && ENABLE_FEATURE_TAR_FROM
833 "\xff::" // cumulative lists for --exclude 833 "\xff::" // cumulative lists for --exclude
834#endif 834#endif
835 USE_FEATURE_TAR_CREATE("c:") "t:x:" // at least one of these is reqd 835 IF_FEATURE_TAR_CREATE("c:") "t:x:" // at least one of these is reqd
836 USE_FEATURE_TAR_CREATE("c--tx:t--cx:x--ct") // mutually exclusive 836 IF_FEATURE_TAR_CREATE("c--tx:t--cx:x--ct") // mutually exclusive
837 SKIP_FEATURE_TAR_CREATE("t--x:x--t"); // mutually exclusive 837 IF_NOT_FEATURE_TAR_CREATE("t--x:x--t"); // mutually exclusive
838#if ENABLE_FEATURE_TAR_LONG_OPTIONS 838#if ENABLE_FEATURE_TAR_LONG_OPTIONS
839 applet_long_options = tar_longopts; 839 applet_long_options = tar_longopts;
840#endif 840#endif
841 opt = getopt32(argv, 841 opt = getopt32(argv,
842 "txC:f:Opvk" 842 "txC:f:Opvk"
843 USE_FEATURE_TAR_CREATE( "ch" ) 843 IF_FEATURE_TAR_CREATE( "ch" )
844 USE_FEATURE_SEAMLESS_BZ2( "j" ) 844 IF_FEATURE_SEAMLESS_BZ2( "j" )
845 USE_FEATURE_SEAMLESS_LZMA("a" ) 845 IF_FEATURE_SEAMLESS_LZMA("a" )
846 USE_FEATURE_TAR_FROM( "T:X:") 846 IF_FEATURE_TAR_FROM( "T:X:")
847 USE_FEATURE_SEAMLESS_GZ( "z" ) 847 IF_FEATURE_SEAMLESS_GZ( "z" )
848 USE_FEATURE_SEAMLESS_Z( "Z" ) 848 IF_FEATURE_SEAMLESS_Z( "Z" )
849 , &base_dir // -C dir 849 , &base_dir // -C dir
850 , &tar_filename // -f filename 850 , &tar_filename // -f filename
851 USE_FEATURE_TAR_FROM(, &(tar_handle->accept)) // T 851 IF_FEATURE_TAR_FROM(, &(tar_handle->accept)) // T
852 USE_FEATURE_TAR_FROM(, &(tar_handle->reject)) // X 852 IF_FEATURE_TAR_FROM(, &(tar_handle->reject)) // X
853#if ENABLE_FEATURE_TAR_LONG_OPTIONS && ENABLE_FEATURE_TAR_FROM 853#if ENABLE_FEATURE_TAR_LONG_OPTIONS && ENABLE_FEATURE_TAR_FROM
854 , &excludes // --exclude 854 , &excludes // --exclude
855#endif 855#endif