# endif
static int writeFileToTarball(const char *fileName, struct stat *statbuf,
- void *userData)
+ void *userData, int depth)
{
struct TarBallInfo *tbInfo = (struct TarBallInfo *) userData;
const char *header_name;
/* If it was a regular file, write out the body */
if (inputFileFd >= 0) {
- ssize_t readSize = 0;
+ off_t readSize = 0;
/* write the file to the archive */
readSize = bb_copyfd_eof(inputFileFd, tbInfo->tarFd);
if (n == 0 && vfork_exec_errno != 0) {
errno = vfork_exec_errno;
- bb_perror_msg_and_die("Could not exec %s", zip_exec);
+ bb_perror_msg_and_die("cannot exec %s", zip_exec);
} else if ((n < 0) && (errno == EAGAIN || errno == EINTR))
continue; /* try it again */
break;
/* Read the directory/files and iterate over them one at a time */
while (include) {
if (!recursive_action(include->data, TRUE, dereferenceFlag,
- FALSE, writeFileToTarball, writeFileToTarball, &tbInfo))
+ FALSE, writeFileToTarball, writeFileToTarball, &tbInfo, 0))
{
errorFlag = TRUE;
}
freeHardLinkInfo(&tbInfo.hlInfoHead);
if (errorFlag)
- bb_error_msg("Error exit delayed from previous errors");
+ bb_error_msg("error exit delayed from previous errors");
if (gzipPid && waitpid(gzipPid, NULL, 0)==-1)
- bb_error_msg("Couldnt wait");
+ bb_error_msg("cannot wait");
return !errorFlag;
}
tmp = cur;
cur = cur->link;
free(tmp);
- while ((line = bb_get_chomped_line_from_file(src_stream)) != NULL) {
+ while ((line = xmalloc_getline(src_stream)) != NULL) {
char *filename_ptr = last_char_is(line, '/');
if (filename_ptr > line)
*filename_ptr = '\0';
#ifdef CONFIG_FEATURE_TAR_COMPRESS
static char get_header_tar_Z(archive_handle_t *archive_handle)
{
- /* Cant lseek over pipe's */
- archive_handle->seek = seek_by_char;
+ /* Can't lseek over pipes */
+ archive_handle->seek = seek_by_read;
/* do the decompression, and cleanup */
if (xread_char(archive_handle->src_fd) != 0x1f ||
/* nothing */;
/* Can only do one file at a time */
- return(EXIT_FAILURE);
+ return EXIT_FAILURE;
}
#else
#define get_header_tar_Z 0
if ((tar_filename[0] == '-') && (tar_filename[1] == '\0')) {
tar_handle->src_fd = fileno(tar_stream);
- tar_handle->seek = seek_by_char;
+ tar_handle->seek = seek_by_read;
} else {
tar_handle->src_fd = xopen3(tar_filename, flags, 0666);
}