diff options
Diffstat (limited to 'tar.c')
-rw-r--r-- | tar.c | 40 |
1 files changed, 20 insertions, 20 deletions
@@ -165,10 +165,10 @@ extern int tar_unzip_init(int tarFd) | |||
165 | signal(SIGCHLD, child_died); | 165 | signal(SIGCHLD, child_died); |
166 | 166 | ||
167 | if (pipe(unzip_pipe)!=0) | 167 | if (pipe(unzip_pipe)!=0) |
168 | error_msg_and_die("pipe error\n"); | 168 | error_msg_and_die("pipe error"); |
169 | 169 | ||
170 | if ( (child_pid = fork()) == -1) | 170 | if ( (child_pid = fork()) == -1) |
171 | error_msg_and_die("fork failure\n"); | 171 | error_msg_and_die("fork failure"); |
172 | 172 | ||
173 | if (child_pid==0) { | 173 | if (child_pid==0) { |
174 | /* child process */ | 174 | /* child process */ |
@@ -259,7 +259,7 @@ extern int tar_main(int argc, char **argv) | |||
259 | break; | 259 | break; |
260 | case 'f': | 260 | case 'f': |
261 | if (*tarName != '-') | 261 | if (*tarName != '-') |
262 | error_msg_and_die( "Only one 'f' option allowed\n"); | 262 | error_msg_and_die( "Only one 'f' option allowed"); |
263 | tarName = optarg; | 263 | tarName = optarg; |
264 | break; | 264 | break; |
265 | #if defined BB_FEATURE_TAR_EXCLUDE | 265 | #if defined BB_FEATURE_TAR_EXCLUDE |
@@ -294,11 +294,11 @@ extern int tar_main(int argc, char **argv) | |||
294 | */ | 294 | */ |
295 | if (createFlag == TRUE) { | 295 | if (createFlag == TRUE) { |
296 | #ifndef BB_FEATURE_TAR_CREATE | 296 | #ifndef BB_FEATURE_TAR_CREATE |
297 | error_msg_and_die( "This version of tar was not compiled with tar creation support.\n"); | 297 | error_msg_and_die( "This version of tar was not compiled with tar creation support."); |
298 | #else | 298 | #else |
299 | #ifdef BB_FEATURE_TAR_GZIP | 299 | #ifdef BB_FEATURE_TAR_GZIP |
300 | if (unzipFlag==TRUE) | 300 | if (unzipFlag==TRUE) |
301 | error_msg_and_die("Creation of compressed not internally support by tar, pipe to busybox gunzip\n"); | 301 | error_msg_and_die("Creation of compressed not internally support by tar, pipe to busybox gunzip"); |
302 | #endif | 302 | #endif |
303 | status = writeTarFile(tarName, verboseFlag, argv + optind, excludeList); | 303 | status = writeTarFile(tarName, verboseFlag, argv + optind, excludeList); |
304 | #endif | 304 | #endif |
@@ -330,7 +330,7 @@ extern int tar_main(int argc, char **argv) | |||
330 | return EXIT_FAILURE; | 330 | return EXIT_FAILURE; |
331 | 331 | ||
332 | flagError: | 332 | flagError: |
333 | error_msg_and_die( "Exactly one of 'c', 'x' or 't' must be specified\n"); | 333 | error_msg_and_die( "Exactly one of 'c', 'x' or 't' must be specified"); |
334 | } | 334 | } |
335 | 335 | ||
336 | static void | 336 | static void |
@@ -383,7 +383,7 @@ tarExtractRegularFile(TarInfo *header, int extractFlag, int tostdoutFlag) | |||
383 | } | 383 | } |
384 | if ( (readSize = full_read(header->tarFd, buffer, readSize)) <= 0 ) { | 384 | if ( (readSize = full_read(header->tarFd, buffer, readSize)) <= 0 ) { |
385 | /* Tarball seems to have a problem */ | 385 | /* Tarball seems to have a problem */ |
386 | error_msg("Unexpected EOF in archive\n"); | 386 | error_msg("Unexpected EOF in archive"); |
387 | return( FALSE); | 387 | return( FALSE); |
388 | } | 388 | } |
389 | if ( readSize < writeSize ) | 389 | if ( readSize < writeSize ) |
@@ -476,7 +476,7 @@ tarExtractSymLink(TarInfo *header, int extractFlag, int tostdoutFlag) | |||
476 | /* Do not change permissions or date on symlink, | 476 | /* Do not change permissions or date on symlink, |
477 | * since it changes the pointed to file instead. duh. */ | 477 | * since it changes the pointed to file instead. duh. */ |
478 | #else | 478 | #else |
479 | error_msg("%s: Cannot create symlink to '%s': %s\n", | 479 | error_msg("%s: Cannot create symlink to '%s': %s", |
480 | header->name, header->linkname, | 480 | header->name, header->linkname, |
481 | "symlinks not supported"); | 481 | "symlinks not supported"); |
482 | #endif | 482 | #endif |
@@ -543,7 +543,7 @@ readTarHeader(struct TarHeader *rawHeader, struct TarInfo *header) | |||
543 | ++*(header->name); | 543 | ++*(header->name); |
544 | 544 | ||
545 | if (alreadyWarned == FALSE) { | 545 | if (alreadyWarned == FALSE) { |
546 | error_msg("Removing leading '/' from member names\n"); | 546 | error_msg("Removing leading '/' from member names"); |
547 | alreadyWarned = TRUE; | 547 | alreadyWarned = TRUE; |
548 | } | 548 | } |
549 | } | 549 | } |
@@ -644,7 +644,7 @@ extern int readTarFile(int tarFd, int extractFlag, int listFlag, | |||
644 | goto endgame; | 644 | goto endgame; |
645 | } else { | 645 | } else { |
646 | errorFlag=TRUE; | 646 | errorFlag=TRUE; |
647 | error_msg("Bad tar header, skipping\n"); | 647 | error_msg("Bad tar header, skipping"); |
648 | continue; | 648 | continue; |
649 | } | 649 | } |
650 | } | 650 | } |
@@ -791,7 +791,7 @@ extern int readTarFile(int tarFd, int extractFlag, int listFlag, | |||
791 | break; | 791 | break; |
792 | #endif | 792 | #endif |
793 | default: | 793 | default: |
794 | error_msg("Unknown file type '%c' in tar file\n", header.type); | 794 | error_msg("Unknown file type '%c' in tar file", header.type); |
795 | close( tarFd); | 795 | close( tarFd); |
796 | return( FALSE); | 796 | return( FALSE); |
797 | } | 797 | } |
@@ -803,7 +803,7 @@ extern int readTarFile(int tarFd, int extractFlag, int listFlag, | |||
803 | return ( FALSE); | 803 | return ( FALSE); |
804 | } | 804 | } |
805 | else if (errorFlag==TRUE) { | 805 | else if (errorFlag==TRUE) { |
806 | error_msg( "Error exit delayed from previous errors\n"); | 806 | error_msg( "Error exit delayed from previous errors"); |
807 | return( FALSE); | 807 | return( FALSE); |
808 | } else | 808 | } else |
809 | return( status); | 809 | return( status); |
@@ -813,7 +813,7 @@ endgame: | |||
813 | close( tarFd); | 813 | close( tarFd); |
814 | if ( *(header.name) == '\0' ) { | 814 | if ( *(header.name) == '\0' ) { |
815 | if (errorFlag==TRUE) | 815 | if (errorFlag==TRUE) |
816 | error_msg( "Error exit delayed from previous errors\n"); | 816 | error_msg( "Error exit delayed from previous errors"); |
817 | else | 817 | else |
818 | return( TRUE); | 818 | return( TRUE); |
819 | } | 819 | } |
@@ -1002,7 +1002,7 @@ writeTarHeader(struct TarBallInfo *tbInfo, const char *header_name, | |||
1002 | header.typeflag = REGTYPE; | 1002 | header.typeflag = REGTYPE; |
1003 | putOctal(header.size, sizeof(header.size), statbuf->st_size); | 1003 | putOctal(header.size, sizeof(header.size), statbuf->st_size); |
1004 | } else { | 1004 | } else { |
1005 | error_msg("%s: Unknown file type\n", real_name); | 1005 | error_msg("%s: Unknown file type", real_name); |
1006 | return ( FALSE); | 1006 | return ( FALSE); |
1007 | } | 1007 | } |
1008 | 1008 | ||
@@ -1061,7 +1061,7 @@ static int writeFileToTarball(const char *fileName, struct stat *statbuf, void* | |||
1061 | 1061 | ||
1062 | /* It is against the rules to archive a socket */ | 1062 | /* It is against the rules to archive a socket */ |
1063 | if (S_ISSOCK(statbuf->st_mode)) { | 1063 | if (S_ISSOCK(statbuf->st_mode)) { |
1064 | error_msg("%s: socket ignored\n", fileName); | 1064 | error_msg("%s: socket ignored", fileName); |
1065 | return( TRUE); | 1065 | return( TRUE); |
1066 | } | 1066 | } |
1067 | 1067 | ||
@@ -1070,7 +1070,7 @@ static int writeFileToTarball(const char *fileName, struct stat *statbuf, void* | |||
1070 | * the new tarball */ | 1070 | * the new tarball */ |
1071 | if (tbInfo->statBuf.st_dev == statbuf->st_dev && | 1071 | if (tbInfo->statBuf.st_dev == statbuf->st_dev && |
1072 | tbInfo->statBuf.st_ino == statbuf->st_ino) { | 1072 | tbInfo->statBuf.st_ino == statbuf->st_ino) { |
1073 | error_msg("%s: file is the archive; skipping\n", fileName); | 1073 | error_msg("%s: file is the archive; skipping", fileName); |
1074 | return( TRUE); | 1074 | return( TRUE); |
1075 | } | 1075 | } |
1076 | 1076 | ||
@@ -1078,7 +1078,7 @@ static int writeFileToTarball(const char *fileName, struct stat *statbuf, void* | |||
1078 | while (header_name[0] == '/') { | 1078 | while (header_name[0] == '/') { |
1079 | static int alreadyWarned=FALSE; | 1079 | static int alreadyWarned=FALSE; |
1080 | if (alreadyWarned==FALSE) { | 1080 | if (alreadyWarned==FALSE) { |
1081 | error_msg("Removing leading '/' from member names\n"); | 1081 | error_msg("Removing leading '/' from member names"); |
1082 | alreadyWarned=TRUE; | 1082 | alreadyWarned=TRUE; |
1083 | } | 1083 | } |
1084 | header_name++; | 1084 | header_name++; |
@@ -1111,7 +1111,7 @@ static int writeFileToTarball(const char *fileName, struct stat *statbuf, void* | |||
1111 | 1111 | ||
1112 | /* open the file we want to archive, and make sure all is well */ | 1112 | /* open the file we want to archive, and make sure all is well */ |
1113 | if ((inputFileFd = open(fileName, O_RDONLY)) < 0) { | 1113 | if ((inputFileFd = open(fileName, O_RDONLY)) < 0) { |
1114 | error_msg("%s: Cannot open: %s\n", fileName, strerror(errno)); | 1114 | error_msg("%s: Cannot open: %s", fileName, strerror(errno)); |
1115 | return( FALSE); | 1115 | return( FALSE); |
1116 | } | 1116 | } |
1117 | 1117 | ||
@@ -1150,7 +1150,7 @@ static int writeTarFile(const char* tarName, int verboseFlag, char **argv, | |||
1150 | 1150 | ||
1151 | /* Make sure there is at least one file to tar up. */ | 1151 | /* Make sure there is at least one file to tar up. */ |
1152 | if (*argv == NULL) | 1152 | if (*argv == NULL) |
1153 | error_msg_and_die("Cowardly refusing to create an empty archive\n"); | 1153 | error_msg_and_die("Cowardly refusing to create an empty archive"); |
1154 | 1154 | ||
1155 | /* Open the tar file for writing. */ | 1155 | /* Open the tar file for writing. */ |
1156 | if (!strcmp(tarName, "-")) | 1156 | if (!strcmp(tarName, "-")) |
@@ -1193,7 +1193,7 @@ static int writeTarFile(const char* tarName, int verboseFlag, char **argv, | |||
1193 | /* Hang up the tools, close up shop, head home */ | 1193 | /* Hang up the tools, close up shop, head home */ |
1194 | close(tarFd); | 1194 | close(tarFd); |
1195 | if (errorFlag == TRUE) { | 1195 | if (errorFlag == TRUE) { |
1196 | error_msg("Error exit delayed from previous errors\n"); | 1196 | error_msg("Error exit delayed from previous errors"); |
1197 | freeHardLinkInfo(&tbInfo.hlInfoHead); | 1197 | freeHardLinkInfo(&tbInfo.hlInfoHead); |
1198 | return(FALSE); | 1198 | return(FALSE); |
1199 | } | 1199 | } |