aboutsummaryrefslogtreecommitdiff
path: root/archival/libarchive
diff options
context:
space:
mode:
authorJames Byrne <james.byrne@origamienergy.com>2019-07-02 11:35:03 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2019-07-02 11:35:03 +0200
commit6937487be73cd4563b876413277a295a5fe2f32c (patch)
treef16cc9999a7c827891e6ec8d99c699fc791008ee /archival/libarchive
parentcaecfdc20d450686cd1f7e9b5f650322f894b3c2 (diff)
downloadbusybox-w32-6937487be73cd4563b876413277a295a5fe2f32c.tar.gz
busybox-w32-6937487be73cd4563b876413277a295a5fe2f32c.tar.bz2
busybox-w32-6937487be73cd4563b876413277a295a5fe2f32c.zip
libbb: reduce the overhead of single parameter bb_error_msg() calls
Back in 2007, commit 0c97c9d43707 ("'simple' error message functions by Loic Grenie") introduced bb_simple_perror_msg() to allow for a lower overhead call to bb_perror_msg() when only a string was being printed with no parameters. This saves space for some CPU architectures because it avoids the overhead of a call to a variadic function. However there has never been a simple version of bb_error_msg(), and since 2007 many new calls to bb_perror_msg() have been added that only take a single parameter and so could have been using bb_simple_perror_message(). This changeset introduces 'simple' versions of bb_info_msg(), bb_error_msg(), bb_error_msg_and_die(), bb_herror_msg() and bb_herror_msg_and_die(), and replaces all calls that only take a single parameter, or use something like ("%s", arg), with calls to the corresponding 'simple' version. Since it is likely that single parameter calls to the variadic functions may be accidentally reintroduced in the future a new debugging config option WARN_SIMPLE_MSG has been introduced. This uses some macro magic which will cause any such calls to generate a warning, but this is turned off by default to avoid use of the unpleasant macros in normal circumstances. This is a large changeset due to the number of calls that have been replaced. The only files that contain changes other than simple substitution of function calls are libbb.h, libbb/herror_msg.c, libbb/verror_msg.c and libbb/xfuncs_printf.c. In miscutils/devfsd.c, networking/udhcp/common.h and util-linux/mdev.c additonal macros have been added for logging so that single parameter and multiple parameter logging variants exist. The amount of space saved varies considerably by architecture, and was found to be as follows (for 'defconfig' using GCC 7.4): Arm: -92 bytes MIPS: -52 bytes PPC: -1836 bytes x86_64: -938 bytes Note that for the MIPS architecture only an exception had to be made disabling the 'simple' calls for 'udhcp' (in networking/udhcp/common.h) because it made these files larger on MIPS. Signed-off-by: James Byrne <james.byrne@origamienergy.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'archival/libarchive')
-rw-r--r--archival/libarchive/data_extract_all.c4
-rw-r--r--archival/libarchive/decompress_bunzip2.c2
-rw-r--r--archival/libarchive/decompress_gunzip.c14
-rw-r--r--archival/libarchive/decompress_uncompress.c10
-rw-r--r--archival/libarchive/decompress_unlzma.c6
-rw-r--r--archival/libarchive/decompress_unxz.c4
-rw-r--r--archival/libarchive/get_header_ar.c8
-rw-r--r--archival/libarchive/get_header_cpio.c6
-rw-r--r--archival/libarchive/get_header_tar.c14
-rw-r--r--archival/libarchive/open_transformer.c6
-rw-r--r--archival/libarchive/seek_by_jump.c2
-rw-r--r--archival/libarchive/unpack_ar_archive.c2
12 files changed, 39 insertions, 39 deletions
diff --git a/archival/libarchive/data_extract_all.c b/archival/libarchive/data_extract_all.c
index 4c95db4a6..3142405a3 100644
--- a/archival/libarchive/data_extract_all.c
+++ b/archival/libarchive/data_extract_all.c
@@ -103,7 +103,7 @@ void FAST_FUNC data_extract_all(archive_handle_t *archive_handle)
103 struct stat existing_sb; 103 struct stat existing_sb;
104 if (lstat(dst_name, &existing_sb) == -1) { 104 if (lstat(dst_name, &existing_sb) == -1) {
105 if (errno != ENOENT) { 105 if (errno != ENOENT) {
106 bb_perror_msg_and_die("can't stat old file"); 106 bb_simple_perror_msg_and_die("can't stat old file");
107 } 107 }
108 } 108 }
109 else if (existing_sb.st_mtime >= file_header->mtime) { 109 else if (existing_sb.st_mtime >= file_header->mtime) {
@@ -207,7 +207,7 @@ void FAST_FUNC data_extract_all(archive_handle_t *archive_handle)
207 } 207 }
208 break; 208 break;
209 default: 209 default:
210 bb_error_msg_and_die("unrecognized file type"); 210 bb_simple_error_msg_and_die("unrecognized file type");
211 } 211 }
212 212
213 if (!S_ISLNK(file_header->mode)) { 213 if (!S_ISLNK(file_header->mode)) {
diff --git a/archival/libarchive/decompress_bunzip2.c b/archival/libarchive/decompress_bunzip2.c
index 1f535b32a..42e2b4f88 100644
--- a/archival/libarchive/decompress_bunzip2.c
+++ b/archival/libarchive/decompress_bunzip2.c
@@ -817,7 +817,7 @@ unpack_bz2_stream(transformer_state_t *xstate)
817 break; 817 break;
818 } 818 }
819 if (bd->headerCRC != bd->totalCRC) { 819 if (bd->headerCRC != bd->totalCRC) {
820 bb_error_msg("CRC error"); 820 bb_simple_error_msg("CRC error");
821 break; 821 break;
822 } 822 }
823 823
diff --git a/archival/libarchive/decompress_gunzip.c b/archival/libarchive/decompress_gunzip.c
index 7f9046b82..1ddce610c 100644
--- a/archival/libarchive/decompress_gunzip.c
+++ b/archival/libarchive/decompress_gunzip.c
@@ -1012,7 +1012,7 @@ inflate_unzip_internal(STATE_PARAM transformer_state_t *xstate)
1012 error_msg = "corrupted data"; 1012 error_msg = "corrupted data";
1013 if (setjmp(error_jmp)) { 1013 if (setjmp(error_jmp)) {
1014 /* Error from deep inside zip machinery */ 1014 /* Error from deep inside zip machinery */
1015 bb_error_msg(error_msg); 1015 bb_simple_error_msg(error_msg);
1016 n = -1; 1016 n = -1;
1017 goto ret; 1017 goto ret;
1018 } 1018 }
@@ -1085,7 +1085,7 @@ static int top_up(STATE_PARAM unsigned n)
1085 bytebuffer_offset = 0; 1085 bytebuffer_offset = 0;
1086 bytebuffer_size = full_read(gunzip_src_fd, &bytebuffer[count], bytebuffer_max - count); 1086 bytebuffer_size = full_read(gunzip_src_fd, &bytebuffer[count], bytebuffer_max - count);
1087 if ((int)bytebuffer_size < 0) { 1087 if ((int)bytebuffer_size < 0) {
1088 bb_error_msg(bb_msg_read_error); 1088 bb_simple_error_msg(bb_msg_read_error);
1089 return 0; 1089 return 0;
1090 } 1090 }
1091 bytebuffer_size += count; 1091 bytebuffer_size += count;
@@ -1211,7 +1211,7 @@ unpack_gz_stream(transformer_state_t *xstate)
1211 1211
1212 if (full_read(xstate->src_fd, &magic2, 2) != 2) { 1212 if (full_read(xstate->src_fd, &magic2, 2) != 2) {
1213 bad_magic: 1213 bad_magic:
1214 bb_error_msg("invalid magic"); 1214 bb_simple_error_msg("invalid magic");
1215 return -1; 1215 return -1;
1216 } 1216 }
1217 if (magic2 == COMPRESS_MAGIC) { 1217 if (magic2 == COMPRESS_MAGIC) {
@@ -1233,7 +1233,7 @@ unpack_gz_stream(transformer_state_t *xstate)
1233 1233
1234 again: 1234 again:
1235 if (!check_header_gzip(PASS_STATE xstate)) { 1235 if (!check_header_gzip(PASS_STATE xstate)) {
1236 bb_error_msg("corrupted data"); 1236 bb_simple_error_msg("corrupted data");
1237 total = -1; 1237 total = -1;
1238 goto ret; 1238 goto ret;
1239 } 1239 }
@@ -1246,7 +1246,7 @@ unpack_gz_stream(transformer_state_t *xstate)
1246 total += n; 1246 total += n;
1247 1247
1248 if (!top_up(PASS_STATE 8)) { 1248 if (!top_up(PASS_STATE 8)) {
1249 bb_error_msg("corrupted data"); 1249 bb_simple_error_msg("corrupted data");
1250 total = -1; 1250 total = -1;
1251 goto ret; 1251 goto ret;
1252 } 1252 }
@@ -1254,7 +1254,7 @@ unpack_gz_stream(transformer_state_t *xstate)
1254 /* Validate decompression - crc */ 1254 /* Validate decompression - crc */
1255 v32 = buffer_read_le_u32(PASS_STATE_ONLY); 1255 v32 = buffer_read_le_u32(PASS_STATE_ONLY);
1256 if ((~gunzip_crc) != v32) { 1256 if ((~gunzip_crc) != v32) {
1257 bb_error_msg("crc error"); 1257 bb_simple_error_msg("crc error");
1258 total = -1; 1258 total = -1;
1259 goto ret; 1259 goto ret;
1260 } 1260 }
@@ -1262,7 +1262,7 @@ unpack_gz_stream(transformer_state_t *xstate)
1262 /* Validate decompression - size */ 1262 /* Validate decompression - size */
1263 v32 = buffer_read_le_u32(PASS_STATE_ONLY); 1263 v32 = buffer_read_le_u32(PASS_STATE_ONLY);
1264 if ((uint32_t)gunzip_bytes_out != v32) { 1264 if ((uint32_t)gunzip_bytes_out != v32) {
1265 bb_error_msg("incorrect length"); 1265 bb_simple_error_msg("incorrect length");
1266 total = -1; 1266 total = -1;
1267 } 1267 }
1268 1268
diff --git a/archival/libarchive/decompress_uncompress.c b/archival/libarchive/decompress_uncompress.c
index 1517559c6..2725a7f09 100644
--- a/archival/libarchive/decompress_uncompress.c
+++ b/archival/libarchive/decompress_uncompress.c
@@ -113,7 +113,7 @@ unpack_Z_stream(transformer_state_t *xstate)
113 /* xread isn't good here, we have to return - caller may want 113 /* xread isn't good here, we have to return - caller may want
114 * to do some cleanup (e.g. delete incomplete unpacked file etc) */ 114 * to do some cleanup (e.g. delete incomplete unpacked file etc) */
115 if (full_read(xstate->src_fd, inbuf, 1) != 1) { 115 if (full_read(xstate->src_fd, inbuf, 1) != 1) {
116 bb_error_msg("short read"); 116 bb_simple_error_msg("short read");
117 goto err; 117 goto err;
118 } 118 }
119 119
@@ -166,7 +166,7 @@ unpack_Z_stream(transformer_state_t *xstate)
166 if (insize < (int) (IBUFSIZ + 64) - IBUFSIZ) { 166 if (insize < (int) (IBUFSIZ + 64) - IBUFSIZ) {
167 rsize = safe_read(xstate->src_fd, inbuf + insize, IBUFSIZ); 167 rsize = safe_read(xstate->src_fd, inbuf + insize, IBUFSIZ);
168 if (rsize < 0) 168 if (rsize < 0)
169 bb_error_msg_and_die(bb_msg_read_error); 169 bb_simple_error_msg_and_die(bb_msg_read_error);
170 insize += rsize; 170 insize += rsize;
171 } 171 }
172 172
@@ -200,7 +200,7 @@ unpack_Z_stream(transformer_state_t *xstate)
200 200
201 if (oldcode == -1) { 201 if (oldcode == -1) {
202 if (code >= 256) 202 if (code >= 256)
203 bb_error_msg_and_die("corrupted data"); /* %ld", code); */ 203 bb_simple_error_msg_and_die("corrupted data"); /* %ld", code); */
204 oldcode = code; 204 oldcode = code;
205 finchar = (int) oldcode; 205 finchar = (int) oldcode;
206 outbuf[outpos++] = (unsigned char) finchar; 206 outbuf[outpos++] = (unsigned char) finchar;
@@ -236,7 +236,7 @@ unpack_Z_stream(transformer_state_t *xstate)
236 insize, posbits, p[-1], p[0], p[1], p[2], p[3], 236 insize, posbits, p[-1], p[0], p[1], p[2], p[3],
237 (posbits & 07)); 237 (posbits & 07));
238*/ 238*/
239 bb_error_msg("corrupted data"); 239 bb_simple_error_msg("corrupted data");
240 goto err; 240 goto err;
241 } 241 }
242 242
@@ -247,7 +247,7 @@ unpack_Z_stream(transformer_state_t *xstate)
247 /* Generate output characters in reverse order */ 247 /* Generate output characters in reverse order */
248 while (code >= 256) { 248 while (code >= 256) {
249 if (stackp <= &htabof(0)) 249 if (stackp <= &htabof(0))
250 bb_error_msg_and_die("corrupted data"); 250 bb_simple_error_msg_and_die("corrupted data");
251 *--stackp = tab_suffixof(code); 251 *--stackp = tab_suffixof(code);
252 code = tab_prefixof(code); 252 code = tab_prefixof(code);
253 } 253 }
diff --git a/archival/libarchive/decompress_unlzma.c b/archival/libarchive/decompress_unlzma.c
index 668b01618..0744f231a 100644
--- a/archival/libarchive/decompress_unlzma.c
+++ b/archival/libarchive/decompress_unlzma.c
@@ -59,7 +59,7 @@ static void rc_read(rc_t *rc)
59//TODO: return -1 instead 59//TODO: return -1 instead
60//This will make unlzma delete broken unpacked file on unpack errors 60//This will make unlzma delete broken unpacked file on unpack errors
61 if (buffer_size <= 0) 61 if (buffer_size <= 0)
62 bb_error_msg_and_die("unexpected EOF"); 62 bb_simple_error_msg_and_die("unexpected EOF");
63 rc->buffer_end = RC_BUFFER + buffer_size; 63 rc->buffer_end = RC_BUFFER + buffer_size;
64 rc->ptr = RC_BUFFER; 64 rc->ptr = RC_BUFFER;
65} 65}
@@ -234,7 +234,7 @@ unpack_lzma_stream(transformer_state_t *xstate)
234 if (full_read(xstate->src_fd, &header, sizeof(header)) != sizeof(header) 234 if (full_read(xstate->src_fd, &header, sizeof(header)) != sizeof(header)
235 || header.pos >= (9 * 5 * 5) 235 || header.pos >= (9 * 5 * 5)
236 ) { 236 ) {
237 bb_error_msg("bad lzma header"); 237 bb_simple_error_msg("bad lzma header");
238 return -1; 238 return -1;
239 } 239 }
240 240
@@ -513,7 +513,7 @@ unpack_lzma_stream(transformer_state_t *xstate)
513 * potentially more detailed information). 513 * potentially more detailed information).
514 * Do not fail silently. 514 * Do not fail silently.
515 */ 515 */
516 bb_error_msg("corrupted data"); 516 bb_simple_error_msg("corrupted data");
517 total_written = -1; /* failure */ 517 total_written = -1; /* failure */
518 } 518 }
519 rc_free(rc); 519 rc_free(rc);
diff --git a/archival/libarchive/decompress_unxz.c b/archival/libarchive/decompress_unxz.c
index 8ae7a275b..f03341384 100644
--- a/archival/libarchive/decompress_unxz.c
+++ b/archival/libarchive/decompress_unxz.c
@@ -74,7 +74,7 @@ unpack_xz_stream(transformer_state_t *xstate)
74 if (iobuf.in_pos == iobuf.in_size) { 74 if (iobuf.in_pos == iobuf.in_size) {
75 int rd = safe_read(xstate->src_fd, membuf, BUFSIZ); 75 int rd = safe_read(xstate->src_fd, membuf, BUFSIZ);
76 if (rd < 0) { 76 if (rd < 0) {
77 bb_error_msg(bb_msg_read_error); 77 bb_simple_error_msg(bb_msg_read_error);
78 total = -1; 78 total = -1;
79 break; 79 break;
80 } 80 }
@@ -123,7 +123,7 @@ unpack_xz_stream(transformer_state_t *xstate)
123 continue; 123 continue;
124 } 124 }
125 if (xz_result != XZ_OK && xz_result != XZ_UNSUPPORTED_CHECK) { 125 if (xz_result != XZ_OK && xz_result != XZ_UNSUPPORTED_CHECK) {
126 bb_error_msg("corrupted data"); 126 bb_simple_error_msg("corrupted data");
127 total = -1; 127 total = -1;
128 break; 128 break;
129 } 129 }
diff --git a/archival/libarchive/get_header_ar.c b/archival/libarchive/get_header_ar.c
index 7ce9c615c..b6ecd596c 100644
--- a/archival/libarchive/get_header_ar.c
+++ b/archival/libarchive/get_header_ar.c
@@ -22,7 +22,7 @@ static unsigned read_num(char *str, int base, int len)
22 * on misformatted numbers bb_strtou returns all-ones */ 22 * on misformatted numbers bb_strtou returns all-ones */
23 err = bb_strtou(str, NULL, base); 23 err = bb_strtou(str, NULL, base);
24 if (err == -1) 24 if (err == -1)
25 bb_error_msg_and_die("invalid ar header"); 25 bb_simple_error_msg_and_die("invalid ar header");
26 return err; 26 return err;
27} 27}
28 28
@@ -53,7 +53,7 @@ char FAST_FUNC get_header_ar(archive_handle_t *archive_handle)
53 archive_handle->offset += 60; 53 archive_handle->offset += 60;
54 54
55 if (ar.formatted.magic[0] != '`' || ar.formatted.magic[1] != '\n') 55 if (ar.formatted.magic[0] != '`' || ar.formatted.magic[1] != '\n')
56 bb_error_msg_and_die("invalid ar header"); 56 bb_simple_error_msg_and_die("invalid ar header");
57 57
58 /* 58 /*
59 * Note that the fields MUST be read in reverse order as 59 * Note that the fields MUST be read in reverse order as
@@ -86,7 +86,7 @@ char FAST_FUNC get_header_ar(archive_handle_t *archive_handle)
86 return get_header_ar(archive_handle); 86 return get_header_ar(archive_handle);
87 } 87 }
88#else 88#else
89 bb_error_msg_and_die("long filenames not supported"); 89 bb_simple_error_msg_and_die("long filenames not supported");
90#endif 90#endif
91 } 91 }
92 /* Only size is always present, the rest may be missing in 92 /* Only size is always present, the rest may be missing in
@@ -107,7 +107,7 @@ char FAST_FUNC get_header_ar(archive_handle_t *archive_handle)
107 long_offset = read_num(&ar.formatted.name[1], 10, 107 long_offset = read_num(&ar.formatted.name[1], 10,
108 sizeof(ar.formatted.name) - 1); 108 sizeof(ar.formatted.name) - 1);
109 if (long_offset >= archive_handle->ar__long_name_size) { 109 if (long_offset >= archive_handle->ar__long_name_size) {
110 bb_error_msg_and_die("can't resolve long filename"); 110 bb_simple_error_msg_and_die("can't resolve long filename");
111 } 111 }
112 typed->name = xstrdup(archive_handle->ar__long_names + long_offset); 112 typed->name = xstrdup(archive_handle->ar__long_names + long_offset);
113 } else 113 } else
diff --git a/archival/libarchive/get_header_cpio.c b/archival/libarchive/get_header_cpio.c
index 75fc6a406..4ad174732 100644
--- a/archival/libarchive/get_header_cpio.c
+++ b/archival/libarchive/get_header_cpio.c
@@ -33,14 +33,14 @@ char FAST_FUNC get_header_cpio(archive_handle_t *archive_handle)
33 goto create_hardlinks; 33 goto create_hardlinks;
34 } 34 }
35 if (size != 110) { 35 if (size != 110) {
36 bb_error_msg_and_die("short read"); 36 bb_simple_error_msg_and_die("short read");
37 } 37 }
38 archive_handle->offset += 110; 38 archive_handle->offset += 110;
39 39
40 if (!is_prefixed_with(&cpio_header[0], "07070") 40 if (!is_prefixed_with(&cpio_header[0], "07070")
41 || (cpio_header[5] != '1' && cpio_header[5] != '2') 41 || (cpio_header[5] != '1' && cpio_header[5] != '2')
42 ) { 42 ) {
43 bb_error_msg_and_die("unsupported cpio format, use newc or crc"); 43 bb_simple_error_msg_and_die("unsupported cpio format, use newc or crc");
44 } 44 }
45 45
46 if (sscanf(cpio_header + 6, 46 if (sscanf(cpio_header + 6,
@@ -50,7 +50,7 @@ char FAST_FUNC get_header_cpio(archive_handle_t *archive_handle)
50 &inode, &mode, &uid, &gid, 50 &inode, &mode, &uid, &gid,
51 &nlink, &mtime, &size, 51 &nlink, &mtime, &size,
52 &major, &minor, &namesize) != 10) 52 &major, &minor, &namesize) != 10)
53 bb_error_msg_and_die("damaged cpio file"); 53 bb_simple_error_msg_and_die("damaged cpio file");
54 file_header->mode = mode; 54 file_header->mode = mode;
55 /* "cpio -R USER:GRP" support: */ 55 /* "cpio -R USER:GRP" support: */
56 if (archive_handle->cpio__owner.uid != (uid_t)-1L) 56 if (archive_handle->cpio__owner.uid != (uid_t)-1L)
diff --git a/archival/libarchive/get_header_tar.c b/archival/libarchive/get_header_tar.c
index 52fa4554a..b3131ff2d 100644
--- a/archival/libarchive/get_header_tar.c
+++ b/archival/libarchive/get_header_tar.c
@@ -32,7 +32,7 @@ static unsigned long long getOctal(char *str, int len)
32 if (*end != '\0' && *end != ' ') { 32 if (*end != '\0' && *end != ' ') {
33 int8_t first = str[0]; 33 int8_t first = str[0];
34 if (!(first & 0x80)) 34 if (!(first & 0x80))
35 bb_error_msg_and_die("corrupted octal value in tar header"); 35 bb_simple_error_msg_and_die("corrupted octal value in tar header");
36 /* 36 /*
37 * GNU tar uses "base-256 encoding" for very large numbers. 37 * GNU tar uses "base-256 encoding" for very large numbers.
38 * Encoding is binary, with highest bit always set as a marker 38 * Encoding is binary, with highest bit always set as a marker
@@ -100,7 +100,7 @@ static void process_pax_hdr(archive_handle_t *archive_handle, unsigned sz, int g
100 || errno != EINVAL 100 || errno != EINVAL
101 || *end != ' ' 101 || *end != ' '
102 ) { 102 ) {
103 bb_error_msg("malformed extended header, skipped"); 103 bb_simple_error_msg("malformed extended header, skipped");
104 // More verbose version: 104 // More verbose version:
105 //bb_error_msg("malformed extended header at %"OFF_FMT"d, skipped", 105 //bb_error_msg("malformed extended header at %"OFF_FMT"d, skipped",
106 // archive_handle->offset - (sz + len)); 106 // archive_handle->offset - (sz + len));
@@ -194,13 +194,13 @@ char FAST_FUNC get_header_tar(archive_handle_t *archive_handle)
194 * the very first read fails. Grrr. 194 * the very first read fails. Grrr.
195 */ 195 */
196 if (archive_handle->offset == 0) 196 if (archive_handle->offset == 0)
197 bb_error_msg("short read"); 197 bb_simple_error_msg("short read");
198 /* this merely signals end of archive, not exit(1): */ 198 /* this merely signals end of archive, not exit(1): */
199 return EXIT_FAILURE; 199 return EXIT_FAILURE;
200 } 200 }
201 if (i != 512) { 201 if (i != 512) {
202 IF_FEATURE_TAR_AUTODETECT(goto autodetect;) 202 IF_FEATURE_TAR_AUTODETECT(goto autodetect;)
203 bb_error_msg_and_die("short read"); 203 bb_simple_error_msg_and_die("short read");
204 } 204 }
205 205
206#else 206#else
@@ -243,11 +243,11 @@ char FAST_FUNC get_header_tar(archive_handle_t *archive_handle)
243 goto err; 243 goto err;
244 if (setup_unzip_on_fd(archive_handle->src_fd, /*fail_if_not_compressed:*/ 0) != 0) 244 if (setup_unzip_on_fd(archive_handle->src_fd, /*fail_if_not_compressed:*/ 0) != 0)
245 err: 245 err:
246 bb_error_msg_and_die("invalid tar magic"); 246 bb_simple_error_msg_and_die("invalid tar magic");
247 archive_handle->offset = 0; 247 archive_handle->offset = 0;
248 goto again_after_align; 248 goto again_after_align;
249#endif 249#endif
250 bb_error_msg_and_die("invalid tar magic"); 250 bb_simple_error_msg_and_die("invalid tar magic");
251 } 251 }
252 252
253 /* Do checksum on headers. 253 /* Do checksum on headers.
@@ -282,7 +282,7 @@ char FAST_FUNC get_header_tar(archive_handle_t *archive_handle)
282 if (sum_u != sum 282 if (sum_u != sum
283 IF_FEATURE_TAR_OLDSUN_COMPATIBILITY(&& sum_s != sum) 283 IF_FEATURE_TAR_OLDSUN_COMPATIBILITY(&& sum_s != sum)
284 ) { 284 ) {
285 bb_error_msg_and_die("invalid tar header checksum"); 285 bb_simple_error_msg_and_die("invalid tar header checksum");
286 } 286 }
287 287
288 /* GET_OCTAL trashes subsequent field, therefore we call it 288 /* GET_OCTAL trashes subsequent field, therefore we call it
diff --git a/archival/libarchive/open_transformer.c b/archival/libarchive/open_transformer.c
index a90f42a45..44715ef25 100644
--- a/archival/libarchive/open_transformer.c
+++ b/archival/libarchive/open_transformer.c
@@ -15,7 +15,7 @@ int FAST_FUNC check_signature16(transformer_state_t *xstate, unsigned magic16)
15 if (!xstate->signature_skipped) { 15 if (!xstate->signature_skipped) {
16 uint16_t magic2; 16 uint16_t magic2;
17 if (full_read(xstate->src_fd, &magic2, 2) != 2 || magic2 != magic16) { 17 if (full_read(xstate->src_fd, &magic2, 2) != 2 || magic2 != magic16) {
18 bb_error_msg("invalid magic"); 18 bb_simple_error_msg("invalid magic");
19 return -1; 19 return -1;
20 } 20 }
21 xstate->signature_skipped = 2; 21 xstate->signature_skipped = 2;
@@ -46,7 +46,7 @@ ssize_t FAST_FUNC transformer_write(transformer_state_t *xstate, const void *buf
46 } else { 46 } else {
47 nwrote = full_write(xstate->dst_fd, buf, bufsize); 47 nwrote = full_write(xstate->dst_fd, buf, bufsize);
48 if (nwrote != (ssize_t)bufsize) { 48 if (nwrote != (ssize_t)bufsize) {
49 bb_perror_msg("write"); 49 bb_simple_perror_msg("write");
50 nwrote = -1; 50 nwrote = -1;
51 goto ret; 51 goto ret;
52 } 52 }
@@ -205,7 +205,7 @@ static transformer_state_t *setup_transformer_on_fd(int fd, int fail_if_not_comp
205 205
206 /* No known magic seen */ 206 /* No known magic seen */
207 if (fail_if_not_compressed) 207 if (fail_if_not_compressed)
208 bb_error_msg_and_die("no gzip" 208 bb_simple_error_msg_and_die("no gzip"
209 IF_FEATURE_SEAMLESS_BZ2("/bzip2") 209 IF_FEATURE_SEAMLESS_BZ2("/bzip2")
210 IF_FEATURE_SEAMLESS_XZ("/xz") 210 IF_FEATURE_SEAMLESS_XZ("/xz")
211 " magic"); 211 " magic");
diff --git a/archival/libarchive/seek_by_jump.c b/archival/libarchive/seek_by_jump.c
index 232d97e53..dddaa3732 100644
--- a/archival/libarchive/seek_by_jump.c
+++ b/archival/libarchive/seek_by_jump.c
@@ -13,6 +13,6 @@ void FAST_FUNC seek_by_jump(int fd, off_t amount)
13 if (errno == ESPIPE) 13 if (errno == ESPIPE)
14 seek_by_read(fd, amount); 14 seek_by_read(fd, amount);
15 else 15 else
16 bb_perror_msg_and_die("seek failure"); 16 bb_simple_perror_msg_and_die("seek failure");
17 } 17 }
18} 18}
diff --git a/archival/libarchive/unpack_ar_archive.c b/archival/libarchive/unpack_ar_archive.c
index 4f9f89874..584c18ce8 100644
--- a/archival/libarchive/unpack_ar_archive.c
+++ b/archival/libarchive/unpack_ar_archive.c
@@ -12,7 +12,7 @@ void FAST_FUNC unpack_ar_archive(archive_handle_t *ar_archive)
12 12
13 xread(ar_archive->src_fd, magic, AR_MAGIC_LEN); 13 xread(ar_archive->src_fd, magic, AR_MAGIC_LEN);
14 if (!is_prefixed_with(magic, AR_MAGIC)) { 14 if (!is_prefixed_with(magic, AR_MAGIC)) {
15 bb_error_msg_and_die("invalid ar magic"); 15 bb_simple_error_msg_and_die("invalid ar magic");
16 } 16 }
17 ar_archive->offset += AR_MAGIC_LEN; 17 ar_archive->offset += AR_MAGIC_LEN;
18 18