int
main(int argc, char *argv[])
{
- static char buff[16384];
struct cpio _cpio; /* Allocated on stack. */
struct cpio *cpio;
struct cpio_owner owner;
cpio = &_cpio;
memset(cpio, 0, sizeof(*cpio));
- cpio->buff = buff;
- cpio->buff_size = sizeof(buff);
-
#if defined(HAVE_SIGACTION)
{
const char *destpath = archive_entry_pathname(entry);
const char *srcpath = archive_entry_sourcepath(entry);
int fd = -1;
- ssize_t bytes_read;
int r;
/* Print out the destination name to the user. */
exit(1);
if (r >= ARCHIVE_WARN && archive_entry_size(entry) > 0 && fd >= 0) {
- bytes_read = read(fd, cpio->buff, (unsigned)cpio->buff_size);
+ static char buff[16384];
+ ssize_t bytes_read;
+
+ bytes_read = read(fd, buff, sizeof(buff));
while (bytes_read > 0) {
ssize_t bytes_write;
bytes_write = archive_write_data(cpio->archive,
- cpio->buff, bytes_read);
+ buff, bytes_read);
if (bytes_write < 0)
lafe_errc(1, archive_errno(cpio->archive),
"%s", archive_error_string(cpio->archive));
"Truncated write; file may have "
"grown while being archived.");
}
- bytes_read = read(fd, cpio->buff,
- (unsigned)cpio->buff_size);
+ bytes_read = read(fd, buff, sizeof(buff));
}
}