ifupdown: save some 100+ bytes of code in addstr()
[oweals/busybox.git] / archival / tar.c
index 5ebb3dff42c13fe0152ac5450d424eb829d8b723..db812e0f4ff14f5d7ac3ee3ff193ed4da162400b 100644 (file)
@@ -301,7 +301,7 @@ static int exclude_file(const llist_t *excluded_files, const char *file)
 # 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;
@@ -457,7 +457,7 @@ static int writeTarFile(const int tar_fd, const int verboseFlag,
 
                                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;
@@ -473,7 +473,7 @@ static int writeTarFile(const int tar_fd, const int verboseFlag,
        /* 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;
                }
@@ -496,7 +496,7 @@ static int writeTarFile(const int tar_fd, const int verboseFlag,
                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("cannot wait");
@@ -523,7 +523,7 @@ static llist_t *append_file_list_to_list(llist_t *list)
                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';
@@ -540,7 +540,7 @@ static llist_t *append_file_list_to_list(llist_t *list)
 #ifdef CONFIG_FEATURE_TAR_COMPRESS
 static char get_header_tar_Z(archive_handle_t *archive_handle)
 {
-       /* Cant lseek over pipe's */
+       /* Can't lseek over pipes */
        archive_handle->seek = seek_by_read;
 
        /* do the decompression, and cleanup */
@@ -556,7 +556,7 @@ static char get_header_tar_Z(archive_handle_t *archive_handle)
                /* nothing */;
 
        /* Can only do one file at a time */
-       return(EXIT_FAILURE);
+       return EXIT_FAILURE;
 }
 #else
 #define get_header_tar_Z       0