summaryrefslogtreecommitdiff
path: root/archival/libunarchive
diff options
context:
space:
mode:
authorManuel Novoa III2003-03-19 09:13:01 +0000
committerManuel Novoa III2003-03-19 09:13:01 +0000
commitcad5364599eb5062d59e0c397ed638ddd61a8d5d (patch)
treea318d0f03aa076c74b576ea45dc543a5669e8e91 /archival/libunarchive
parente01f9662a5bd5d91be4f6b3941b57fff73cd5af1 (diff)
downloadbusybox-cad5364599eb5062d59e0c397ed638ddd61a8d5d.zip
busybox-cad5364599eb5062d59e0c397ed638ddd61a8d5d.tar.gz
Major coreutils update.
Diffstat (limited to 'archival/libunarchive')
-rw-r--r--archival/libunarchive/archive_copy_file.c2
-rw-r--r--archival/libunarchive/archive_xread.c2
-rw-r--r--archival/libunarchive/archive_xread_all.c2
-rw-r--r--archival/libunarchive/archive_xread_all_eof.c2
-rw-r--r--archival/libunarchive/check_header_gzip.c16
-rw-r--r--archival/libunarchive/data_extract_all.c16
-rw-r--r--archival/libunarchive/decompress_bunzip2.c8
-rw-r--r--archival/libunarchive/decompress_uncompress.c8
-rw-r--r--archival/libunarchive/decompress_unzip.c32
-rw-r--r--archival/libunarchive/get_header_ar.c16
-rw-r--r--archival/libunarchive/get_header_cpio.c16
-rw-r--r--archival/libunarchive/get_header_tar.c10
-rw-r--r--archival/libunarchive/get_header_tar_gz.c2
-rw-r--r--archival/libunarchive/header_verbose_list.c2
-rw-r--r--archival/libunarchive/seek_by_jump.c2
-rw-r--r--archival/libunarchive/uncompress.c8
-rw-r--r--archival/libunarchive/unpack_ar_archive.c2
-rw-r--r--archival/libunarchive/unzip.c32
18 files changed, 89 insertions, 89 deletions
diff --git a/archival/libunarchive/archive_copy_file.c b/archival/libunarchive/archive_copy_file.c
index faa8059..675bc6f 100644
--- a/archival/libunarchive/archive_copy_file.c
+++ b/archival/libunarchive/archive_copy_file.c
@@ -35,7 +35,7 @@ extern void archive_copy_file(const archive_handle_t *archive_handle, const int
size = archive_xread(archive_handle, buffer, size);
if (write(dst_fd, buffer, size) != size) {
- error_msg_and_die ("Short write");
+ bb_error_msg_and_die ("Short write");
}
chunksize -= size;
}
diff --git a/archival/libunarchive/archive_xread.c b/archival/libunarchive/archive_xread.c
index 7fde4c0..0b29dbf 100644
--- a/archival/libunarchive/archive_xread.c
+++ b/archival/libunarchive/archive_xread.c
@@ -26,7 +26,7 @@ extern ssize_t archive_xread(const archive_handle_t *archive_handle, unsigned ch
size = archive_handle->read(archive_handle->src_fd, buf, count);
if (size == -1) {
- perror_msg_and_die("Read error");
+ bb_perror_msg_and_die("Read error");
}
return(size);
diff --git a/archival/libunarchive/archive_xread_all.c b/archival/libunarchive/archive_xread_all.c
index ef8cc01..cfe046b 100644
--- a/archival/libunarchive/archive_xread_all.c
+++ b/archival/libunarchive/archive_xread_all.c
@@ -26,7 +26,7 @@ extern void archive_xread_all(const archive_handle_t *archive_handle, void *buf,
size = archive_xread(archive_handle, buf, count);
if (size != count) {
- error_msg_and_die("Short read");
+ bb_error_msg_and_die("Short read");
}
return;
}
diff --git a/archival/libunarchive/archive_xread_all_eof.c b/archival/libunarchive/archive_xread_all_eof.c
index 3cfbbd8..23719cd 100644
--- a/archival/libunarchive/archive_xread_all_eof.c
+++ b/archival/libunarchive/archive_xread_all_eof.c
@@ -26,7 +26,7 @@ extern ssize_t archive_xread_all_eof(archive_handle_t *archive_handle, unsigned
size = archive_xread(archive_handle, buf, count);
if ((size != 0) && (size != count)) {
- perror_msg_and_die("Short read, read %d of %d", size, count);
+ bb_perror_msg_and_die("Short read, read %d of %d", size, count);
}
return(size);
}
diff --git a/archival/libunarchive/check_header_gzip.c b/archival/libunarchive/check_header_gzip.c
index d661df7..13832c2 100644
--- a/archival/libunarchive/check_header_gzip.c
+++ b/archival/libunarchive/check_header_gzip.c
@@ -15,11 +15,11 @@ extern void check_header_gzip(int src_fd)
} formated;
} header;
- xread_all(src_fd, header.raw, 8);
+ bb_xread_all(src_fd, header.raw, 8);
/* Check the compression method */
if (header.formated.method != 8) {
- error_msg_and_die("Unknown compression method %d",
+ bb_error_msg_and_die("Unknown compression method %d",
header.formated.method);
}
@@ -27,10 +27,10 @@ extern void check_header_gzip(int src_fd)
/* bit 2 set: extra field present */
unsigned char extra_short;
- extra_short = xread_char(src_fd) + (xread_char(src_fd) << 8);
+ extra_short = bb_xread_char(src_fd) + (bb_xread_char(src_fd) << 8);
while (extra_short > 0) {
/* Ignore extra field */
- xread_char(src_fd);
+ bb_xread_char(src_fd);
extra_short--;
}
}
@@ -38,19 +38,19 @@ extern void check_header_gzip(int src_fd)
/* Discard original name if any */
if (header.formated.flags & 0x08) {
/* bit 3 set: original file name present */
- while(xread_char(src_fd) != 0);
+ while(bb_xread_char(src_fd) != 0);
}
/* Discard file comment if any */
if (header.formated.flags & 0x10) {
/* bit 4 set: file comment present */
- while(xread_char(src_fd) != 0);
+ while(bb_xread_char(src_fd) != 0);
}
/* Read the header checksum */
if (header.formated.flags & 0x02) {
- xread_char(src_fd);
- xread_char(src_fd);
+ bb_xread_char(src_fd);
+ bb_xread_char(src_fd);
}
return;
diff --git a/archival/libunarchive/data_extract_all.c b/archival/libunarchive/data_extract_all.c
index 1eb8bb3..77b4de5 100644
--- a/archival/libunarchive/data_extract_all.c
+++ b/archival/libunarchive/data_extract_all.c
@@ -34,8 +34,8 @@ extern void data_extract_all(archive_handle_t *archive_handle)
int res;
if (archive_handle->flags & ARCHIVE_CREATE_LEADING_DIRS) {
- char *name = xstrdup(file_header->name);
- make_directory (dirname(name), 0777, FILEUTILS_RECUR);
+ char *name = bb_xstrdup(file_header->name);
+ bb_make_directory (dirname(name), 0777, FILEUTILS_RECUR);
free(name);
}
@@ -47,13 +47,13 @@ extern void data_extract_all(archive_handle_t *archive_handle)
/* hard link */
res = link(file_header->link_name, file_header->name);
if ((res == -1) && !(archive_handle->flags & ARCHIVE_EXTRACT_QUIET)) {
- perror_msg("Couldnt create hard link");
+ bb_perror_msg("Couldnt create hard link");
}
} else
#endif
{
/* Regular file */
- dst_fd = xopen(file_header->name, O_WRONLY | O_CREAT);
+ dst_fd = bb_xopen(file_header->name, O_WRONLY | O_CREAT);
archive_copy_file(archive_handle, dst_fd);
close(dst_fd);
}
@@ -63,7 +63,7 @@ extern void data_extract_all(archive_handle_t *archive_handle)
unlink(file_header->name);
res = mkdir(file_header->name, file_header->mode);
if ((res == -1) && !(archive_handle->flags & ARCHIVE_EXTRACT_QUIET)) {
- perror_msg("extract_archive: %s", file_header->name);
+ bb_perror_msg("extract_archive: %s", file_header->name);
}
break;
case S_IFLNK:
@@ -71,7 +71,7 @@ extern void data_extract_all(archive_handle_t *archive_handle)
unlink(file_header->name);
res = symlink(file_header->link_name, file_header->name);
if ((res == -1) && !(archive_handle->flags & ARCHIVE_EXTRACT_QUIET)) {
- perror_msg("Cannot create symlink from %s to '%s'", file_header->name, file_header->link_name);
+ bb_perror_msg("Cannot create symlink from %s to '%s'", file_header->name, file_header->link_name);
}
break;
case S_IFSOCK:
@@ -81,11 +81,11 @@ extern void data_extract_all(archive_handle_t *archive_handle)
unlink(file_header->name);
res = mknod(file_header->name, file_header->mode, file_header->device);
if ((res == -1) && !(archive_handle->flags & ARCHIVE_EXTRACT_QUIET)) {
- perror_msg("Cannot create node %s", file_header->name);
+ bb_perror_msg("Cannot create node %s", file_header->name);
}
break;
default:
- error_msg_and_die("Unrecognised file type");
+ bb_error_msg_and_die("Unrecognised file type");
}
chmod(file_header->name, file_header->mode);
diff --git a/archival/libunarchive/decompress_bunzip2.c b/archival/libunarchive/decompress_bunzip2.c
index 4b611b8..0164b77 100644
--- a/archival/libunarchive/decompress_bunzip2.c
+++ b/archival/libunarchive/decompress_bunzip2.c
@@ -1548,7 +1548,7 @@ extern ssize_t read_bz2(int fd, void *buf, size_t count)
while (1) {
if (bzf->strm.avail_in == 0) {
- n = xread(bzf->fd, bzf->buf, BZ_MAX_UNUSED);
+ n = bb_xread(bzf->fd, bzf->buf, BZ_MAX_UNUSED);
if (n == 0) {
break;
}
@@ -1560,7 +1560,7 @@ extern ssize_t read_bz2(int fd, void *buf, size_t count)
ret = BZ2_bzDecompress(&(bzf->strm));
if ((ret != BZ_OK) && (ret != BZ_STREAM_END)) {
- error_msg_and_die("Error decompressing");
+ bb_error_msg_and_die("Error decompressing");
}
if (ret == BZ_STREAM_END) {
@@ -1628,12 +1628,12 @@ extern unsigned char uncompressStream(int src_fd, int dst_fd)
while (bzerr == BZ_OK) {
nread = read_bz2(src_fd, obuf, 5000);
if (bzerr == BZ_DATA_ERROR_MAGIC) {
- error_msg_and_die("invalid magic");
+ bb_error_msg_and_die("invalid magic");
}
if (((bzerr == BZ_OK) || (bzerr == BZ_STREAM_END)) && (nread > 0)) {
if (write(dst_fd, obuf, nread) != nread) {
BZ2_bzReadClose();
- perror_msg_and_die("Couldnt write to file");
+ bb_perror_msg_and_die("Couldnt write to file");
}
}
}
diff --git a/archival/libunarchive/decompress_uncompress.c b/archival/libunarchive/decompress_uncompress.c
index 192e981..9851ca3 100644
--- a/archival/libunarchive/decompress_uncompress.c
+++ b/archival/libunarchive/decompress_uncompress.c
@@ -121,14 +121,14 @@ extern int uncompress(int fd_in, int fd_out)
insize = 0;
- inbuf[0] = xread_char(fd_in);
+ inbuf[0] = bb_xread_char(fd_in);
maxbits = inbuf[0] & BIT_MASK;
block_mode = inbuf[0] & BLOCK_MODE;
maxmaxcode = MAXCODE(maxbits);
if (maxbits > BITS) {
- error_msg("compressed with %d bits, can only handle %d bits", maxbits,
+ bb_error_msg("compressed with %d bits, can only handle %d bits", maxbits,
BITS);
return -1;
}
@@ -227,11 +227,11 @@ extern int uncompress(int fd_in, int fd_out)
posbits -= n_bits;
p = &inbuf[posbits >> 3];
- error_msg
+ bb_error_msg
("insize:%d posbits:%d inbuf:%02X %02X %02X %02X %02X (%d)",
insize, posbits, p[-1], p[0], p[1], p[2], p[3],
(posbits & 07));
- error_msg("uncompress: corrupt input");
+ bb_error_msg("uncompress: corrupt input");
return -1;
}
diff --git a/archival/libunarchive/decompress_unzip.c b/archival/libunarchive/decompress_unzip.c
index 3a7334c..2401cf8 100644
--- a/archival/libunarchive/decompress_unzip.c
+++ b/archival/libunarchive/decompress_unzip.c
@@ -150,7 +150,7 @@ static void fill_bytebuffer(void)
/* Leave the first 4 bytes empty so we can always unwind the bitbuffer
* to the front of the bytebuffer, leave 4 bytes free at end of tail
* so we can easily top up buffer in check_trailer_gzip() */
- bytebuffer_size = 4 + xread(gunzip_src_fd, &bytebuffer[4], BYTEBUFFER_MAX - 8);
+ bytebuffer_size = 4 + bb_xread(gunzip_src_fd, &bytebuffer[4], BYTEBUFFER_MAX - 8);
bytebuffer_offset = 4;
}
}
@@ -448,7 +448,7 @@ static int inflate_codes(huft_t * my_tl, huft_t * my_td, const unsigned int my_b
if ((e = (t = tl + ((unsigned) b & ml))->e) > 16)
do {
if (e == 99) {
- error_msg_and_die("inflate_codes error 1");;
+ bb_error_msg_and_die("inflate_codes error 1");;
}
b >>= t->b;
k -= t->b;
@@ -484,7 +484,7 @@ static int inflate_codes(huft_t * my_tl, huft_t * my_td, const unsigned int my_b
if ((e = (t = td + ((unsigned) b & md))->e) > 16)
do {
if (e == 99)
- error_msg_and_die("inflate_codes error 2");;
+ bb_error_msg_and_die("inflate_codes error 2");;
b >>= t->b;
k -= t->b;
e -= 16;
@@ -821,7 +821,7 @@ static int inflate_block(int *e)
if ((i = huft_build(ll, nl, 257, cplens, cplext, &tl, &bl)) != 0) {
if (i == 1) {
- error_msg_and_die("Incomplete literal tree");
+ bb_error_msg_and_die("Incomplete literal tree");
huft_free(tl);
}
return i; /* incomplete code set */
@@ -830,7 +830,7 @@ static int inflate_block(int *e)
bd = dbits;
if ((i = huft_build(ll + nl, nd, 0, cpdist, cpdext, &td, &bd)) != 0) {
if (i == 1) {
- error_msg_and_die("incomplete distance tree");
+ bb_error_msg_and_die("incomplete distance tree");
huft_free(td);
}
huft_free(tl);
@@ -846,7 +846,7 @@ static int inflate_block(int *e)
}
default:
/* bad block type */
- error_msg_and_die("bad block type %d\n", t);
+ bb_error_msg_and_die("bad block type %d\n", t);
}
}
@@ -884,7 +884,7 @@ static int inflate_get_next_window(void)
break;
case -2: ret = inflate_codes(0,0,0,0,0);
break;
- default: error_msg_and_die("inflate error %d", method);
+ default: bb_error_msg_and_die("inflate error %d", method);
}
if (ret == 1) {
@@ -975,16 +975,16 @@ extern void GZ_gzReadClose(void)
ssize_t nread, nwrote;
GZ_gzReadOpen(in, 0, 0);
- while(1) { // Robbed from copyfd.c
+ while(1) { // Robbed from bb_copyfd.c
nread = read_gz(in, buf, sizeof(buf));
if (nread == 0) break; // no data to write
else if (nread == -1) {
- perror_msg("read");
+ bb_perror_msg("read");
return -1;
}
- nwrote = full_write(out, buf, nread);
+ nwrote = bb_full_write(out, buf, nread);
if (nwrote == -1) {
- perror_msg("write");
+ bb_perror_msg("write");
return -1;
}
}
@@ -998,9 +998,9 @@ extern int inflate(int in, int out)
GZ_gzReadOpen(in, 0, 0);
while(1) {
int ret = inflate_get_next_window();
- nwrote = full_write(out, gunzip_window, gunzip_outbuf_count);
+ nwrote = bb_full_write(out, gunzip_window, gunzip_outbuf_count);
if (nwrote == -1) {
- perror_msg("write");
+ bb_perror_msg("write");
return -1;
}
if (ret == 0) break;
@@ -1017,7 +1017,7 @@ extern void check_trailer_gzip(int src_fd)
/* top up the input buffer with the rest of the trailer */
count = bytebuffer_size - bytebuffer_offset;
if (count < 8) {
- xread_all(src_fd, &bytebuffer[bytebuffer_size], 8 - count);
+ bb_xread_all(src_fd, &bytebuffer[bytebuffer_size], 8 - count);
bytebuffer_size += 8 - count;
}
for (count = 0; count != 4; count++) {
@@ -1027,14 +1027,14 @@ extern void check_trailer_gzip(int src_fd)
/* Validate decompression - crc */
if (stored_crc != (gunzip_crc ^ 0xffffffffL)) {
- error_msg_and_die("crc error");
+ bb_error_msg_and_die("crc error");
}
/* Validate decompression - size */
if (gunzip_bytes_out !=
(bytebuffer[bytebuffer_offset] | (bytebuffer[bytebuffer_offset+1] << 8) |
(bytebuffer[bytebuffer_offset+2] << 16) | (bytebuffer[bytebuffer_offset+3] << 24))) {
- error_msg_and_die("Incorrect length, but crc is correct");
+ bb_error_msg_and_die("Incorrect length, but crc is correct");
}
}
diff --git a/archival/libunarchive/get_header_ar.c b/archival/libunarchive/get_header_ar.c
index 1e0e6c1..6c576a8 100644
--- a/archival/libunarchive/get_header_ar.c
+++ b/archival/libunarchive/get_header_ar.c
@@ -41,7 +41,7 @@ extern char get_header_ar(archive_handle_t *archive_handle)
static unsigned int ar_long_name_size;
#endif
- /* dont use xread as we want to handle the error ourself */
+ /* dont use bb_xread as we want to handle the error ourself */
if (read(archive_handle->src_fd, ar.raw, 60) != 60) {
/* End Of File */
return(EXIT_FAILURE);
@@ -51,14 +51,14 @@ extern char get_header_ar(archive_handle_t *archive_handle)
if (ar.raw[0] == '\n') {
/* fix up the header, we started reading 1 byte too early */
memmove(ar.raw, &ar.raw[1], 59);
- ar.raw[59] = xread_char(archive_handle->src_fd);
+ ar.raw[59] = bb_xread_char(archive_handle->src_fd);
archive_handle->offset++;
}
archive_handle->offset += 60;
/* align the headers based on the header magic */
if ((ar.formated.magic[0] != '`') || (ar.formated.magic[1] != '\n')) {
- error_msg_and_die("Invalid ar header");
+ bb_error_msg_and_die("Invalid ar header");
}
typed->mode = strtol(ar.formated.mode, NULL, 8);
@@ -76,7 +76,7 @@ extern char get_header_ar(archive_handle_t *archive_handle)
* in static variable long_names for use in future entries */
ar_long_name_size = typed->size;
ar_long_names = xmalloc(ar_long_name_size);
- xread_all(archive_handle->src_fd, ar_long_names, ar_long_name_size);
+ bb_xread_all(archive_handle->src_fd, ar_long_names, ar_long_name_size);
archive_handle->offset += ar_long_name_size;
/* This ar entries data section only contained filenames for other records
* they are stored in the static ar_long_names for future reference */
@@ -90,16 +90,16 @@ extern char get_header_ar(archive_handle_t *archive_handle)
(saved in variable long_name) that conatains the real filename */
const unsigned int long_offset = atoi(&ar.formated.name[1]);
if (long_offset >= ar_long_name_size) {
- error_msg_and_die("Cant resolve long filename");
+ bb_error_msg_and_die("Cant resolve long filename");
}
- typed->name = xstrdup(ar_long_names + long_offset);
+ typed->name = bb_xstrdup(ar_long_names + long_offset);
}
#else
- error_msg_and_die("long filenames not supported");
+ bb_error_msg_and_die("long filenames not supported");
#endif
} else {
/* short filenames */
- typed->name = xstrndup(ar.formated.name, 16);
+ typed->name = bb_xstrndup(ar.formated.name, 16);
}
typed->name[strcspn(typed->name, " /")] = '\0';
diff --git a/archival/libunarchive/get_header_cpio.c b/archival/libunarchive/get_header_cpio.c
index ea08578..975e2a4 100644
--- a/archival/libunarchive/get_header_cpio.c
+++ b/archival/libunarchive/get_header_cpio.c
@@ -46,7 +46,7 @@ extern char get_header_cpio(archive_handle_t *archive_handle)
oldtmp = NULL;
while (tmp) {
- error_msg_and_die("need to fix this\n");
+ bb_error_msg_and_die("need to fix this\n");
if (tmp->entry->link_name) { /* Found a hardlink ready to be extracted */
file_header = tmp->entry;
if (oldtmp) {
@@ -78,11 +78,11 @@ extern char get_header_cpio(archive_handle_t *archive_handle)
cpio_header[2],
cpio_header[3],
cpio_header[4]);
- error_msg_and_die("Unsupported cpio format");
+ bb_error_msg_and_die("Unsupported cpio format");
}
if ((cpio_header[5] != '1') && (cpio_header[5] != '2')) {
- error_msg_and_die("Unsupported cpio format, use newc or crc");
+ bb_error_msg_and_die("Unsupported cpio format, use newc or crc");
}
{
@@ -109,7 +109,7 @@ extern char get_header_cpio(archive_handle_t *archive_handle)
hardlinks_t *tmp = saved_hardlinks;
hardlinks_t *oldtmp = NULL;
while (tmp) {
- error_msg("%s not created: cannot resolve hardlink", tmp->entry->name);
+ bb_error_msg("%s not created: cannot resolve hardlink", tmp->entry->name);
oldtmp = tmp;
tmp = tmp->next;
free (oldtmp->entry->name);
@@ -142,13 +142,13 @@ extern char get_header_cpio(archive_handle_t *archive_handle)
pending_hardlinks = 1;
while (tmp) {
if (tmp->inode == inode) {
- tmp->entry->link_name = xstrdup(file_header->name);
+ tmp->entry->link_name = bb_xstrdup(file_header->name);
nlink--;
}
tmp = tmp->next;
}
if (nlink > 1) {
- error_msg("error resolving hardlink: did you create the archive with GNU cpio 2.0-2.2?");
+ bb_error_msg("error resolving hardlink: did you create the archive with GNU cpio 2.0-2.2?");
}
}
}
@@ -165,11 +165,11 @@ extern char get_header_cpio(archive_handle_t *archive_handle)
if ((archive_handle->flags & ARCHIVE_EXTRACT_UNCONDITIONAL) || (statbuf.st_mtime < file_header->mtime)) {
/* Remove file if flag set or its older than the file to be extracted */
if (unlink(file_header->name) == -1) {
- perror_msg_and_die("Couldnt remove old file");
+ bb_perror_msg_and_die("Couldnt remove old file");
}
} else {
if (! archive_handle->flags & ARCHIVE_EXTRACT_QUIET) {
- error_msg("%s not created: newer or same age file exists", file_header->name);
+ bb_error_msg("%s not created: newer or same age file exists", file_header->name);
}
extract_flag = FALSE;
}
diff --git a/archival/libunarchive/get_header_tar.c b/archival/libunarchive/get_header_tar.c
index 2cb141e..365f464 100644
--- a/archival/libunarchive/get_header_tar.c
+++ b/archival/libunarchive/get_header_tar.c
@@ -75,7 +75,7 @@ extern char get_header_tar(archive_handle_t *archive_handle)
#ifdef CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY
if (strncmp(tar.formated.magic, "\0\0\0\0\0", 5) != 0)
#endif
- error_msg_and_die("Invalid tar magic");
+ bb_error_msg_and_die("Invalid tar magic");
}
/* Do checksum on headers */
for (i = 0; i < 148 ; i++) {
@@ -86,7 +86,7 @@ extern char get_header_tar(archive_handle_t *archive_handle)
sum += tar.raw[i];
}
if (sum != strtol(tar.formated.chksum, NULL, 8)) {
- error_msg("Invalid tar header checksum");
+ bb_error_msg("Invalid tar header checksum");
return(EXIT_FAILURE);
}
@@ -116,7 +116,7 @@ extern char get_header_tar(archive_handle_t *archive_handle)
file_header->size = strtol(tar.formated.size, NULL, 8);
file_header->mtime = strtol(tar.formated.mtime, NULL, 8);
file_header->link_name = (tar.formated.linkname[0] != '\0') ?
- xstrdup(tar.formated.linkname) : NULL;
+ bb_xstrdup(tar.formated.linkname) : NULL;
file_header->device = (dev_t) ((strtol(tar.formated.devmajor, NULL, 8) << 8) +
strtol(tar.formated.devminor, NULL, 8));
@@ -129,7 +129,7 @@ extern char get_header_tar(archive_handle_t *archive_handle)
file_header->mode |= S_IFREG;
break;
case '1':
- error_msg("Internal hard link not supported");
+ bb_error_msg("Internal hard link not supported");
break;
case '2':
file_header->mode |= S_IFLNK;
@@ -170,7 +170,7 @@ extern char get_header_tar(archive_handle_t *archive_handle)
case 'N':
case 'S':
case 'V':
- error_msg("Ignoring GNU extension type %c", tar.formated.typeflag);
+ bb_error_msg("Ignoring GNU extension type %c", tar.formated.typeflag);
# endif
}
#endif
diff --git a/archival/libunarchive/get_header_tar_gz.c b/archival/libunarchive/get_header_tar_gz.c
index a4355d2..7792432 100644
--- a/archival/libunarchive/get_header_tar_gz.c
+++ b/archival/libunarchive/get_header_tar_gz.c
@@ -25,7 +25,7 @@ extern char get_header_tar_gz(archive_handle_t *archive_handle)
archive_xread_all(archive_handle, &magic, 2);
if ((magic[0] != 0x1f) || (magic[1] != 0x8b)) {
- error_msg_and_die("Invalid gzip magic");
+ bb_error_msg_and_die("Invalid gzip magic");
}
check_header_gzip(archive_handle->src_fd);
diff --git a/archival/libunarchive/header_verbose_list.c b/archival/libunarchive/header_verbose_list.c
index ff7b3bc..6739dd3 100644
--- a/archival/libunarchive/header_verbose_list.c
+++ b/archival/libunarchive/header_verbose_list.c
@@ -9,7 +9,7 @@ extern void header_verbose_list(const file_header_t *file_header)
struct tm *mtime = localtime(&file_header->mtime);
printf("%s %d/%d%10u %4u-%02u-%02u %02u:%02u:%02u %s",
- mode_string(file_header->mode),
+ bb_mode_string(file_header->mode),
file_header->uid,
file_header->gid,
(unsigned int) file_header->size,
diff --git a/archival/libunarchive/seek_by_jump.c b/archival/libunarchive/seek_by_jump.c
index 2823976..578870d 100644
--- a/archival/libunarchive/seek_by_jump.c
+++ b/archival/libunarchive/seek_by_jump.c
@@ -30,6 +30,6 @@ extern void seek_by_jump(const archive_handle_t *archive_handle, const unsigned
seek_by_char(archive_handle, amount);
} else
#endif
- perror_msg_and_die("Seek failure");
+ bb_perror_msg_and_die("Seek failure");
}
}
diff --git a/archival/libunarchive/uncompress.c b/archival/libunarchive/uncompress.c
index 192e981..9851ca3 100644
--- a/archival/libunarchive/uncompress.c
+++ b/archival/libunarchive/uncompress.c
@@ -121,14 +121,14 @@ extern int uncompress(int fd_in, int fd_out)
insize = 0;
- inbuf[0] = xread_char(fd_in);
+ inbuf[0] = bb_xread_char(fd_in);
maxbits = inbuf[0] & BIT_MASK;
block_mode = inbuf[0] & BLOCK_MODE;
maxmaxcode = MAXCODE(maxbits);
if (maxbits > BITS) {
- error_msg("compressed with %d bits, can only handle %d bits", maxbits,
+ bb_error_msg("compressed with %d bits, can only handle %d bits", maxbits,
BITS);
return -1;
}
@@ -227,11 +227,11 @@ extern int uncompress(int fd_in, int fd_out)
posbits -= n_bits;
p = &inbuf[posbits >> 3];
- error_msg
+ bb_error_msg
("insize:%d posbits:%d inbuf:%02X %02X %02X %02X %02X (%d)",
insize, posbits, p[-1], p[0], p[1], p[2], p[3],
(posbits & 07));
- error_msg("uncompress: corrupt input");
+ bb_error_msg("uncompress: corrupt input");
return -1;
}
diff --git a/archival/libunarchive/unpack_ar_archive.c b/archival/libunarchive/unpack_ar_archive.c
index afa3672..e8f113b 100644
--- a/archival/libunarchive/unpack_ar_archive.c
+++ b/archival/libunarchive/unpack_ar_archive.c
@@ -26,7 +26,7 @@ extern void unpack_ar_archive(archive_handle_t *ar_archive)
archive_xread_all(ar_archive, magic, 7);
if (strncmp(magic, "!<arch>", 7) != 0) {
- error_msg_and_die("Invalid ar magic");
+ bb_error_msg_and_die("Invalid ar magic");
}
ar_archive->offset += 7;
diff --git a/archival/libunarchive/unzip.c b/archival/libunarchive/unzip.c
index 3a7334c..2401cf8 100644
--- a/archival/libunarchive/unzip.c
+++ b/archival/libunarchive/unzip.c
@@ -150,7 +150,7 @@ static void fill_bytebuffer(void)
/* Leave the first 4 bytes empty so we can always unwind the bitbuffer
* to the front of the bytebuffer, leave 4 bytes free at end of tail
* so we can easily top up buffer in check_trailer_gzip() */
- bytebuffer_size = 4 + xread(gunzip_src_fd, &bytebuffer[4], BYTEBUFFER_MAX - 8);
+ bytebuffer_size = 4 + bb_xread(gunzip_src_fd, &bytebuffer[4], BYTEBUFFER_MAX - 8);
bytebuffer_offset = 4;
}
}
@@ -448,7 +448,7 @@ static int inflate_codes(huft_t * my_tl, huft_t * my_td, const unsigned int my_b
if ((e = (t = tl + ((unsigned) b & ml))->e) > 16)
do {
if (e == 99) {
- error_msg_and_die("inflate_codes error 1");;
+ bb_error_msg_and_die("inflate_codes error 1");;
}
b >>= t->b;
k -= t->b;
@@ -484,7 +484,7 @@ static int inflate_codes(huft_t * my_tl, huft_t * my_td, const unsigned int my_b
if ((e = (t = td + ((unsigned) b & md))->e) > 16)
do {
if (e == 99)
- error_msg_and_die("inflate_codes error 2");;
+ bb_error_msg_and_die("inflate_codes error 2");;
b >>= t->b;
k -= t->b;
e -= 16;
@@ -821,7 +821,7 @@ static int inflate_block(int *e)
if ((i = huft_build(ll, nl, 257, cplens, cplext, &tl, &bl)) != 0) {
if (i == 1) {
- error_msg_and_die("Incomplete literal tree");
+ bb_error_msg_and_die("Incomplete literal tree");
huft_free(tl);
}
return i; /* incomplete code set */
@@ -830,7 +830,7 @@ static int inflate_block(int *e)
bd = dbits;
if ((i = huft_build(ll + nl, nd, 0, cpdist, cpdext, &td, &bd)) != 0) {
if (i == 1) {
- error_msg_and_die("incomplete distance tree");
+ bb_error_msg_and_die("incomplete distance tree");
huft_free(td);
}
huft_free(tl);
@@ -846,7 +846,7 @@ static int inflate_block(int *e)
}
default:
/* bad block type */
- error_msg_and_die("bad block type %d\n", t);
+ bb_error_msg_and_die("bad block type %d\n", t);
}
}
@@ -884,7 +884,7 @@ static int inflate_get_next_window(void)
break;
case -2: ret = inflate_codes(0,0,0,0,0);
break;
- default: error_msg_and_die("inflate error %d", method);
+ default: bb_error_msg_and_die("inflate error %d", method);
}
if (ret == 1) {
@@ -975,16 +975,16 @@ extern void GZ_gzReadClose(void)
ssize_t nread, nwrote;
GZ_gzReadOpen(in, 0, 0);
- while(1) { // Robbed from copyfd.c
+ while(1) { // Robbed from bb_copyfd.c
nread = read_gz(in, buf, sizeof(buf));
if (nread == 0) break; // no data to write
else if (nread == -1) {
- perror_msg("read");
+ bb_perror_msg("read");
return -1;
}
- nwrote = full_write(out, buf, nread);
+ nwrote = bb_full_write(out, buf, nread);
if (nwrote == -1) {
- perror_msg("write");
+ bb_perror_msg("write");
return -1;
}
}
@@ -998,9 +998,9 @@ extern int inflate(int in, int out)
GZ_gzReadOpen(in, 0, 0);
while(1) {
int ret = inflate_get_next_window();
- nwrote = full_write(out, gunzip_window, gunzip_outbuf_count);
+ nwrote = bb_full_write(out, gunzip_window, gunzip_outbuf_count);
if (nwrote == -1) {
- perror_msg("write");
+ bb_perror_msg("write");
return -1;
}
if (ret == 0) break;
@@ -1017,7 +1017,7 @@ extern void check_trailer_gzip(int src_fd)
/* top up the input buffer with the rest of the trailer */
count = bytebuffer_size - bytebuffer_offset;
if (count < 8) {
- xread_all(src_fd, &bytebuffer[bytebuffer_size], 8 - count);
+ bb_xread_all(src_fd, &bytebuffer[bytebuffer_size], 8 - count);
bytebuffer_size += 8 - count;
}
for (count = 0; count != 4; count++) {
@@ -1027,14 +1027,14 @@ extern void check_trailer_gzip(int src_fd)
/* Validate decompression - crc */
if (stored_crc != (gunzip_crc ^ 0xffffffffL)) {
- error_msg_and_die("crc error");
+ bb_error_msg_and_die("crc error");
}
/* Validate decompression - size */
if (gunzip_bytes_out !=
(bytebuffer[bytebuffer_offset] | (bytebuffer[bytebuffer_offset+1] << 8) |
(bytebuffer[bytebuffer_offset+2] << 16) | (bytebuffer[bytebuffer_offset+3] << 24))) {
- error_msg_and_die("Incorrect length, but crc is correct");
+ bb_error_msg_and_die("Incorrect length, but crc is correct");
}
}