summaryrefslogtreecommitdiff
path: root/archival
diff options
context:
space:
mode:
authorMark Whitley2000-12-07 19:56:48 +0000
committerMark Whitley2000-12-07 19:56:48 +0000
commitf57c944e09417edcbcd69f2b01b937cadef39db2 (patch)
treea55822621d54bd82c54e272fa986e45698fea0f1 /archival
parent7b5c16ebe5f1b057603cf1c0b0187be418725c42 (diff)
downloadbusybox-f57c944e09417edcbcd69f2b01b937cadef39db2.zip
busybox-f57c944e09417edcbcd69f2b01b937cadef39db2.tar.gz
Changed names of functions in utility.c and all affected files, to make
compliant with the style guide. Everybody rebuild your tags file!
Diffstat (limited to 'archival')
-rw-r--r--archival/ar.c24
-rw-r--r--archival/gunzip.c22
-rw-r--r--archival/gzip.c18
-rw-r--r--archival/tar.c106
4 files changed, 85 insertions, 85 deletions
diff --git a/archival/ar.c b/archival/ar.c
index a9a0a0a..88cdd4f 100644
--- a/archival/ar.c
+++ b/archival/ar.c
@@ -106,7 +106,7 @@ static int checkTarMagic(int srcFd)
headerStart = lseek(srcFd, 0, SEEK_CUR);
lseek(srcFd, (off_t) 257, SEEK_CUR);
- fullRead(srcFd, magic, 6);
+ full_read(srcFd, magic, 6);
lseek(srcFd, headerStart, SEEK_SET);
if (strncmp(magic, "ustar", 5)!=0)
return(FALSE);
@@ -123,7 +123,7 @@ static int readTarHeader(int srcFd, headerL_t *current)
off_t initialOffset;
initialOffset = lseek(srcFd, 0, SEEK_CUR);
- if (fullRead(srcFd, (char *) &rawTarHeader, 512) != 512) {
+ if (full_read(srcFd, (char *) &rawTarHeader, 512) != 512) {
lseek(srcFd, initialOffset, SEEK_SET);
return(FALSE);
}
@@ -157,8 +157,8 @@ static int checkArMagic(int srcFd)
char arMagic[8];
headerStart = lseek(srcFd, 0, SEEK_CUR);
- if (fullRead(srcFd, arMagic, 8) != 8) {
- errorMsg("fatal error\n");
+ if (full_read(srcFd, arMagic, 8) != 8) {
+ error_msg("fatal error\n");
return (FALSE);
}
lseek(srcFd, headerStart, SEEK_SET);
@@ -178,7 +178,7 @@ static int readArEntry(int srcFd, headerL_t *entry)
off_t initialOffset;
initialOffset = lseek(srcFd, 0, SEEK_CUR);
- if (fullRead(srcFd, (char *) &rawArHeader, 60) != 60) {
+ if (full_read(srcFd, (char *) &rawArHeader, 60) != 60) {
lseek(srcFd, initialOffset, SEEK_SET);
return(FALSE);
}
@@ -215,7 +215,7 @@ static int readArEntry(int srcFd, headerL_t *entry)
if (entry->size > MAX_NAME_LENGTH)
entry->size = MAX_NAME_LENGTH;
- fullRead(srcFd, tempName, entry->size);
+ full_read(srcFd, tempName, entry->size);
tempName[entry->size-3]='\0';
/* read the second header for this entry */
@@ -226,7 +226,7 @@ static int readArEntry(int srcFd, headerL_t *entry)
if ((entry->name[0]='/') && (entry->name[1]='0'))
strcpy(entry->name, tempName);
else {
- errorMsg("Invalid long filename\n");
+ error_msg("Invalid long filename\n");
return(FALSE);
}
}
@@ -343,7 +343,7 @@ extern int ar_main(int argc, char **argv)
usage(ar_usage);
if ( (srcFd = open(argv[optind], O_RDONLY)) < 0)
- fatalError("Cannot read %s\n", argv[optind]);
+ error_msg_and_die("Cannot read %s\n", argv[optind]);
optind++;
entry = (headerL_t *) xmalloc(sizeof(headerL_t));
@@ -368,8 +368,8 @@ extern int ar_main(int argc, char **argv)
while(extractList->next != NULL) {
if (funct & EXT_TO_FILE) {
- if (isDirectory(extractList->name, TRUE, NULL)==FALSE)
- createPath(extractList->name, 0666);
+ if (is_directory(extractList->name, TRUE, NULL)==FALSE)
+ create_path(extractList->name, 0666);
dstFd = open(extractList->name, O_WRONLY | O_CREAT, extractList->mode);
lseek(srcFd, extractList->offset, SEEK_SET);
copy_file_chunk(srcFd, dstFd, (size_t) extractList->size);
@@ -380,9 +380,9 @@ extern int ar_main(int argc, char **argv)
}
if ( (funct & DISPLAY) || (funct & VERBOSE)) {
if (funct & VERBOSE)
- printf("%s %d/%d %8d %s ", modeString(extractList->mode),
+ printf("%s %d/%d %8d %s ", mode_string(extractList->mode),
extractList->uid, extractList->gid,
- extractList->size, timeString(extractList->mtime));
+ extractList->size, time_string(extractList->mtime));
printf("%s\n", extractList->name);
}
extractList=extractList->next;
diff --git a/archival/gunzip.c b/archival/gunzip.c
index eeff977..a5846c3 100644
--- a/archival/gunzip.c
+++ b/archival/gunzip.c
@@ -113,7 +113,7 @@ static char *license_msg[] = {
/* Diagnostic functions */
#ifdef DEBUG
-# define Assert(cond,msg) {if(!(cond)) errorMsg(msg);}
+# define Assert(cond,msg) {if(!(cond)) error_msg(msg);}
# define Trace(x) fprintf x
# define Tracev(x) {if (verbose) fprintf x ;}
# define Tracevv(x) {if (verbose>1) fprintf x ;}
@@ -297,7 +297,7 @@ int in; /* input file descriptor */
method = (int) get_byte();
if (method != DEFLATED) {
- errorMsg("unknown method %d -- get newer version of gzip\n", method);
+ error_msg("unknown method %d -- get newer version of gzip\n", method);
exit_code = ERROR;
return -1;
}
@@ -1114,13 +1114,13 @@ int in, out; /* input and output file descriptors */
int res = inflate();
if (res == 3) {
- errorMsg(memory_exhausted);
+ error_msg(memory_exhausted);
} else if (res != 0) {
- errorMsg("invalid compressed data--format violated\n");
+ error_msg("invalid compressed data--format violated\n");
}
} else {
- errorMsg("internal error, invalid method\n");
+ error_msg("internal error, invalid method\n");
}
/* Get the crc and original length */
@@ -1149,10 +1149,10 @@ int in, out; /* input and output file descriptors */
/* Validate decompression */
if (orig_crc != updcrc(outbuf, 0)) {
- errorMsg("invalid compressed data--crc error\n");
+ error_msg("invalid compressed data--crc error\n");
}
if (orig_len != (ulg) bytes_out) {
- errorMsg("invalid compressed data--length error\n");
+ error_msg("invalid compressed data--length error\n");
}
/* Check if there are more entries in a pkzip file */
@@ -1225,9 +1225,9 @@ int gunzip_main(int argc, char **argv)
}
if (isatty(fileno(stdin)) && fromstdin==1 && force==0)
- fatalError( "data not read from terminal. Use -f to force it.\n");
+ error_msg_and_die( "data not read from terminal. Use -f to force it.\n");
if (isatty(fileno(stdout)) && tostdout==1 && force==0)
- fatalError( "data not written to terminal. Use -f to force it.\n");
+ error_msg_and_die( "data not written to terminal. Use -f to force it.\n");
foreground = signal(SIGINT, SIG_IGN) != SIG_IGN;
@@ -1265,7 +1265,7 @@ int gunzip_main(int argc, char **argv)
if (argc <= 0)
usage(gunzip_usage);
if (strlen(*argv) > MAX_PATH_LEN) {
- errorMsg(name_too_long);
+ error_msg(name_too_long);
exit(WARNING);
}
strcpy(ifname, *argv);
@@ -1304,7 +1304,7 @@ int gunzip_main(int argc, char **argv)
/* And get to work */
if (strlen(ifname) > MAX_PATH_LEN - 4) {
- errorMsg(name_too_long);
+ error_msg(name_too_long);
exit(WARNING);
}
strcpy(ofname, ifname);
diff --git a/archival/gzip.c b/archival/gzip.c
index d8c22a9..49c429b 100644
--- a/archival/gzip.c
+++ b/archival/gzip.c
@@ -114,7 +114,7 @@ extern int method; /* compression method */
# define DECLARE(type, array, size) type * array
# define ALLOC(type, array, size) { \
array = (type*)calloc((size_t)(((size)+1L)/2), 2*sizeof(type)); \
- if (array == NULL) errorMsg(memory_exhausted); \
+ if (array == NULL) error_msg(memory_exhausted); \
}
# define FREE(array) {if (array != NULL) free(array), array=NULL;}
#else
@@ -251,7 +251,7 @@ extern int save_orig_name; /* set if original name must be saved */
/* Diagnostic functions */
#ifdef DEBUG
-# define Assert(cond,msg) {if(!(cond)) errorMsg(msg);}
+# define Assert(cond,msg) {if(!(cond)) error_msg(msg);}
# define Trace(x) fprintf x
# define Tracev(x) {if (verbose) fprintf x ;}
# define Tracevv(x) {if (verbose>1) fprintf x ;}
@@ -1381,7 +1381,7 @@ int length;
(char *) window + start, length) != EQUAL) {
fprintf(stderr,
" start %d, match %d, length %d\n", start, match, length);
- errorMsg("invalid match\n");
+ error_msg("invalid match\n");
}
if (verbose > 1) {
fprintf(stderr, "\\[%d,%d]", start - match, length);
@@ -1819,9 +1819,9 @@ int gzip_main(int argc, char **argv)
}
if (isatty(fileno(stdin)) && fromstdin==1 && force==0)
- fatalError( "data not read from terminal. Use -f to force it.\n");
+ error_msg_and_die( "data not read from terminal. Use -f to force it.\n");
if (isatty(fileno(stdout)) && tostdout==1 && force==0)
- fatalError( "data not written to terminal. Use -f to force it.\n");
+ error_msg_and_die( "data not written to terminal. Use -f to force it.\n");
foreground = signal(SIGINT, SIG_IGN) != SIG_IGN;
if (foreground) {
@@ -2900,7 +2900,7 @@ int eof; /* true if this is the last block for a file */
#endif
/* Since LIT_BUFSIZE <= 2*WSIZE, the input data must be there: */
if (buf == (char *) 0)
- errorMsg("block vanished\n");
+ error_msg("block vanished\n");
copy_block(buf, (unsigned) stored_len, 0); /* without header */
compressed_len = stored_len << 3;
@@ -3083,7 +3083,7 @@ local void set_file_type()
bin_freq += dyn_ltree[n++].Freq;
*file_type = bin_freq > (ascii_freq >> 2) ? BINARY : ASCII;
if (*file_type == BINARY && translate_eol) {
- errorMsg("-l used on binary file\n");
+ error_msg("-l used on binary file\n");
}
}
@@ -3239,13 +3239,13 @@ char *env; /* name of environment variable */
nargv = (char **) calloc(*argcp + 1, sizeof(char *));
if (nargv == NULL)
- errorMsg(memory_exhausted);
+ error_msg(memory_exhausted);
oargv = *argvp;
*argvp = nargv;
/* Copy the program name first */
if (oargc-- < 0)
- errorMsg("argc<=0\n");
+ error_msg("argc<=0\n");
*(nargv++) = *(oargv++);
/* Then copy the environment args */
diff --git a/archival/tar.c b/archival/tar.c
index 906fd7e..cc7ba3b 100644
--- a/archival/tar.c
+++ b/archival/tar.c
@@ -193,10 +193,10 @@ extern int tar_main(int argc, char **argv)
break;
case 'f':
if (*tarName != '-')
- fatalError( "Only one 'f' option allowed\n");
+ error_msg_and_die( "Only one 'f' option allowed\n");
tarName = *(++argv);
if (tarName == NULL)
- fatalError( "Option requires an argument: No file specified\n");
+ error_msg_and_die( "Option requires an argument: No file specified\n");
stopIt=TRUE;
break;
#if defined BB_FEATURE_TAR_EXCLUDE
@@ -205,7 +205,7 @@ extern int tar_main(int argc, char **argv)
excludeList=xrealloc( excludeList, sizeof(char**) * (excludeListSize+2));
excludeList[excludeListSize] = *(++argv);
if (excludeList[excludeListSize] == NULL)
- fatalError( "Option requires an argument: No file specified\n");
+ error_msg_and_die( "Option requires an argument: No file specified\n");
/* Remove leading "/"s */
if (*excludeList[excludeListSize] =='/')
excludeList[excludeListSize] = (excludeList[excludeListSize])+1;
@@ -216,13 +216,13 @@ extern int tar_main(int argc, char **argv)
}
case 'X':
if (*excludeFileName != '-')
- fatalError("Only one 'X' option allowed\n");
+ error_msg_and_die("Only one 'X' option allowed\n");
excludeFileName = *(++argv);
if (excludeFileName == NULL)
- fatalError("Option requires an argument: No file specified\n");
+ error_msg_and_die("Option requires an argument: No file specified\n");
fileList = fopen (excludeFileName, "rt");
if (! fileList)
- fatalError("Exclude file: file not found\n");
+ error_msg_and_die("Exclude file: file not found\n");
while (!feof(fileList)) {
fscanf(fileList, "%s", file);
excludeList=xrealloc( excludeList, sizeof(char**) * (excludeListSize+2));
@@ -253,7 +253,7 @@ extern int tar_main(int argc, char **argv)
*/
if (createFlag == TRUE) {
#ifndef BB_FEATURE_TAR_CREATE
- fatalError( "This version of tar was not compiled with tar creation support.\n");
+ error_msg_and_die( "This version of tar was not compiled with tar creation support.\n");
#else
status = writeTarFile(tarName, verboseFlag, argv, excludeList);
#endif
@@ -271,7 +271,7 @@ extern int tar_main(int argc, char **argv)
return EXIT_FAILURE;
flagError:
- fatalError( "Exactly one of 'c', 'x' or 't' must be specified\n");
+ error_msg_and_die( "Exactly one of 'c', 'x' or 't' must be specified\n");
}
static void
@@ -301,10 +301,10 @@ tarExtractRegularFile(TarInfo *header, int extractFlag, int tostdoutFlag)
if (extractFlag==TRUE && tostdoutFlag==FALSE) {
/* Create the path to the file, just in case it isn't there...
* This should not screw up path permissions or anything. */
- createPath(header->name, 0777);
+ create_path(header->name, 0777);
if ((outFd=open(header->name, O_CREAT|O_TRUNC|O_WRONLY,
header->mode & ~S_IFMT)) < 0) {
- errorMsg(io_error, header->name, strerror(errno));
+ error_msg(io_error, header->name, strerror(errno));
return( FALSE);
}
}
@@ -322,9 +322,9 @@ tarExtractRegularFile(TarInfo *header, int extractFlag, int tostdoutFlag)
readSize = size;
writeSize = size;
}
- if ( (readSize = fullRead(header->tarFd, buffer, readSize)) <= 0 ) {
+ if ( (readSize = full_read(header->tarFd, buffer, readSize)) <= 0 ) {
/* Tarball seems to have a problem */
- errorMsg("Unexpected EOF in archive\n");
+ error_msg("Unexpected EOF in archive\n");
return( FALSE);
}
if ( readSize < writeSize )
@@ -333,9 +333,9 @@ tarExtractRegularFile(TarInfo *header, int extractFlag, int tostdoutFlag)
/* Write out the file, if we are supposed to be doing that */
if (extractFlag==TRUE) {
- if ((actualWriteSz=fullWrite(outFd, buffer, writeSize)) != writeSize ) {
+ if ((actualWriteSz=full_write(outFd, buffer, writeSize)) != writeSize ) {
/* Output file seems to have a problem */
- errorMsg(io_error, header->name, strerror(errno));
+ error_msg(io_error, header->name, strerror(errno));
return( FALSE);
}
} else {
@@ -361,13 +361,13 @@ tarExtractDirectory(TarInfo *header, int extractFlag, int tostdoutFlag)
if (extractFlag==FALSE || tostdoutFlag==TRUE)
return( TRUE);
- if (createPath(header->name, header->mode) != TRUE) {
- errorMsg("%s: Cannot mkdir: %s\n",
+ if (create_path(header->name, header->mode) != TRUE) {
+ error_msg("%s: Cannot mkdir: %s\n",
header->name, strerror(errno));
return( FALSE);
}
/* make the final component, just in case it was
- * omitted by createPath() (which will skip the
+ * omitted by create_path() (which will skip the
* directory if it doesn't have a terminating '/') */
if (mkdir(header->name, header->mode) == 0) {
fixUpPermissions(header);
@@ -382,7 +382,7 @@ tarExtractHardLink(TarInfo *header, int extractFlag, int tostdoutFlag)
return( TRUE);
if (link(header->linkname, header->name) < 0) {
- errorMsg("%s: Cannot create hard link to '%s': %s\n",
+ error_msg("%s: Cannot create hard link to '%s': %s\n",
header->name, header->linkname, strerror(errno));
return( FALSE);
}
@@ -400,7 +400,7 @@ tarExtractSymLink(TarInfo *header, int extractFlag, int tostdoutFlag)
#ifdef S_ISLNK
if (symlink(header->linkname, header->name) < 0) {
- errorMsg("%s: Cannot create symlink to '%s': %s\n",
+ error_msg("%s: Cannot create symlink to '%s': %s\n",
header->name, header->linkname, strerror(errno));
return( FALSE);
}
@@ -415,7 +415,7 @@ tarExtractSymLink(TarInfo *header, int extractFlag, int tostdoutFlag)
/* Do not change permissions or date on symlink,
* since it changes the pointed to file instead. duh. */
#else
- errorMsg("%s: Cannot create symlink to '%s': %s\n",
+ error_msg("%s: Cannot create symlink to '%s': %s\n",
header->name, header->linkname,
"symlinks not supported");
#endif
@@ -430,13 +430,13 @@ tarExtractSpecial(TarInfo *header, int extractFlag, int tostdoutFlag)
if (S_ISCHR(header->mode) || S_ISBLK(header->mode) || S_ISSOCK(header->mode)) {
if (mknod(header->name, header->mode, makedev(header->devmajor, header->devminor)) < 0) {
- errorMsg("%s: Cannot mknod: %s\n",
+ error_msg("%s: Cannot mknod: %s\n",
header->name, strerror(errno));
return( FALSE);
}
} else if (S_ISFIFO(header->mode)) {
if (mkfifo(header->name, header->mode) < 0) {
- errorMsg("%s: Cannot mkfifo: %s\n",
+ error_msg("%s: Cannot mkfifo: %s\n",
header->name, strerror(errno));
return( FALSE);
}
@@ -455,9 +455,9 @@ static long getOctal(const char *cp, int size)
long val = 0;
for(;(size > 0) && (*cp == ' '); cp++, size--);
- if ((size == 0) || !isOctal(*cp))
+ if ((size == 0) || !is_octal(*cp))
return -1;
- for(; (size > 0) && isOctal(*cp); size--) {
+ for(; (size > 0) && is_octal(*cp); size--) {
val = val * 8 + *cp++ - '0';
}
for (;(size > 0) && (*cp == ' '); cp++, size--);
@@ -484,7 +484,7 @@ readTarHeader(struct TarHeader *rawHeader, struct TarInfo *header)
++*(header->name);
if (alreadyWarned == FALSE) {
- errorMsg("Removing leading '/' from member names\n");
+ error_msg("Removing leading '/' from member names\n");
alreadyWarned = TRUE;
}
}
@@ -538,7 +538,7 @@ static int readTarFile(const char* tarName, int extractFlag, int listFlag,
else
tarFd = open(tarName, O_RDONLY);
if (tarFd < 0) {
- errorMsg( "Error opening '%s': %s\n", tarName, strerror(errno));
+ error_msg( "Error opening '%s': %s\n", tarName, strerror(errno));
return ( FALSE);
}
@@ -547,7 +547,7 @@ static int readTarFile(const char* tarName, int extractFlag, int listFlag,
umask(0);
/* Read the tar file, and iterate over it one file at a time */
- while ( (status = fullRead(tarFd, (char*)&rawHeader, TAR_BLOCK_SIZE)) == TAR_BLOCK_SIZE ) {
+ while ( (status = full_read(tarFd, (char*)&rawHeader, TAR_BLOCK_SIZE)) == TAR_BLOCK_SIZE ) {
/* Try to read the header */
if ( readTarHeader(&rawHeader, &header) == FALSE ) {
@@ -555,7 +555,7 @@ static int readTarFile(const char* tarName, int extractFlag, int listFlag,
goto endgame;
} else {
errorFlag=TRUE;
- errorMsg("Bad tar header, skipping\n");
+ error_msg("Bad tar header, skipping\n");
continue;
}
}
@@ -572,7 +572,7 @@ static int readTarFile(const char* tarName, int extractFlag, int listFlag,
}
if ( skipNextHeaderFlag == TRUE ) {
skipNextHeaderFlag=FALSE;
- errorMsg(name_longer_than_foo, NAME_SIZE);
+ error_msg(name_longer_than_foo, NAME_SIZE);
if (tarExtractRegularFile(&header, FALSE, FALSE) == FALSE)
errorFlag = TRUE;
continue;
@@ -638,7 +638,7 @@ static int readTarFile(const char* tarName, int extractFlag, int listFlag,
char buf[35];
struct tm *tm = localtime (&(header.mtime));
- len=printf("%s ", modeString(header.mode));
+ len=printf("%s ", mode_string(header.mode));
memset(buf, 0, 8*sizeof(char));
my_getpwuid(buf, header.uid);
if (! *buf)
@@ -731,7 +731,7 @@ static int readTarFile(const char* tarName, int extractFlag, int listFlag,
break;
#endif
default:
- errorMsg("Unknown file type '%c' in tar file\n", header.type);
+ error_msg("Unknown file type '%c' in tar file\n", header.type);
close( tarFd);
return( FALSE);
}
@@ -739,11 +739,11 @@ static int readTarFile(const char* tarName, int extractFlag, int listFlag,
close(tarFd);
if (status > 0) {
/* Bummer - we read a partial header */
- errorMsg( "Error reading '%s': %s\n", tarName, strerror(errno));
+ error_msg( "Error reading '%s': %s\n", tarName, strerror(errno));
return ( FALSE);
}
else if (errorFlag==TRUE) {
- errorMsg( "Error exit delayed from previous errors\n");
+ error_msg( "Error exit delayed from previous errors\n");
return( FALSE);
} else
return( status);
@@ -753,13 +753,13 @@ endgame:
close( tarFd);
if (extractList != NULL) {
for (; *extractList != NULL; extractList++) {
- errorMsg("%s: Not found in archive\n", *extractList);
+ error_msg("%s: Not found in archive\n", *extractList);
errorFlag = TRUE;
}
}
if ( *(header.name) == '\0' ) {
if (errorFlag==TRUE)
- errorMsg( "Error exit delayed from previous errors\n");
+ error_msg( "Error exit delayed from previous errors\n");
else
return( TRUE);
}
@@ -903,7 +903,7 @@ writeTarHeader(struct TarBallInfo *tbInfo, const char *fileName, struct stat *st
if (*fileName=='/') {
static int alreadyWarned=FALSE;
if (alreadyWarned==FALSE) {
- errorMsg("Removing leading '/' from member names\n");
+ error_msg("Removing leading '/' from member names\n");
alreadyWarned=TRUE;
}
strncpy(header.name, fileName+1, sizeof(header.name));
@@ -956,7 +956,7 @@ writeTarHeader(struct TarBallInfo *tbInfo, const char *fileName, struct stat *st
header.typeflag = SYMTYPE;
link_size = readlink(fileName, buffer, sizeof(buffer) - 1);
if ( link_size < 0) {
- errorMsg("Error reading symlink '%s': %s\n", header.name, strerror(errno));
+ error_msg("Error reading symlink '%s': %s\n", header.name, strerror(errno));
return ( FALSE);
}
buffer[link_size] = '\0';
@@ -978,7 +978,7 @@ writeTarHeader(struct TarBallInfo *tbInfo, const char *fileName, struct stat *st
header.typeflag = REGTYPE;
putOctal(header.size, sizeof(header.size), statbuf->st_size);
} else {
- errorMsg("%s: Unknown file type\n", fileName);
+ error_msg("%s: Unknown file type\n", fileName);
return ( FALSE);
}
@@ -994,8 +994,8 @@ writeTarHeader(struct TarBallInfo *tbInfo, const char *fileName, struct stat *st
putOctal(header.chksum, 7, chksum);
/* Now write the header out to disk */
- if ((size=fullWrite(tbInfo->tarFd, (char*)&header, sizeof(struct TarHeader))) < 0) {
- errorMsg(io_error, fileName, strerror(errno));
+ if ((size=full_write(tbInfo->tarFd, (char*)&header, sizeof(struct TarHeader))) < 0) {
+ error_msg(io_error, fileName, strerror(errno));
return ( FALSE);
}
/* Pad the header up to the tar block size */
@@ -1036,7 +1036,7 @@ static int writeFileToTarball(const char *fileName, struct stat *statbuf, void*
/* It is against the rules to archive a socket */
if (S_ISSOCK(statbuf->st_mode)) {
- errorMsg("%s: socket ignored\n", fileName);
+ error_msg("%s: socket ignored\n", fileName);
return( TRUE);
}
@@ -1045,12 +1045,12 @@ static int writeFileToTarball(const char *fileName, struct stat *statbuf, void*
* the new tarball */
if (tbInfo->statBuf.st_dev == statbuf->st_dev &&
tbInfo->statBuf.st_ino == statbuf->st_ino) {
- errorMsg("%s: file is the archive; skipping\n", fileName);
+ error_msg("%s: file is the archive; skipping\n", fileName);
return( TRUE);
}
if (strlen(fileName) >= NAME_SIZE) {
- errorMsg(name_longer_than_foo, NAME_SIZE);
+ error_msg(name_longer_than_foo, NAME_SIZE);
return ( TRUE);
}
@@ -1067,21 +1067,21 @@ static int writeFileToTarball(const char *fileName, struct stat *statbuf, void*
/* open the file we want to archive, and make sure all is well */
if ((inputFileFd = open(fileName, O_RDONLY)) < 0) {
- errorMsg("%s: Cannot open: %s\n", fileName, strerror(errno));
+ error_msg("%s: Cannot open: %s\n", fileName, strerror(errno));
return( FALSE);
}
/* write the file to the archive */
- while ( (size = fullRead(inputFileFd, buffer, sizeof(buffer))) > 0 ) {
- if (fullWrite(tbInfo->tarFd, buffer, size) != size ) {
+ while ( (size = full_read(inputFileFd, buffer, sizeof(buffer))) > 0 ) {
+ if (full_write(tbInfo->tarFd, buffer, size) != size ) {
/* Output file seems to have a problem */
- errorMsg(io_error, fileName, strerror(errno));
+ error_msg(io_error, fileName, strerror(errno));
return( FALSE);
}
readSize+=size;
}
if (size == -1) {
- errorMsg(io_error, fileName, strerror(errno));
+ error_msg(io_error, fileName, strerror(errno));
return( FALSE);
}
/* Pad the file up to the tar block size */
@@ -1106,7 +1106,7 @@ static int writeTarFile(const char* tarName, int verboseFlag, char **argv,
/* Make sure there is at least one file to tar up. */
if (*argv == NULL)
- fatalError("Cowardly refusing to create an empty archive\n");
+ error_msg_and_die("Cowardly refusing to create an empty archive\n");
/* Open the tar file for writing. */
if (!strcmp(tarName, "-"))
@@ -1114,7 +1114,7 @@ static int writeTarFile(const char* tarName, int verboseFlag, char **argv,
else
tbInfo.tarFd = open (tarName, O_WRONLY | O_CREAT | O_TRUNC, 0644);
if (tbInfo.tarFd < 0) {
- errorMsg( "Error opening '%s': %s\n", tarName, strerror(errno));
+ error_msg( "Error opening '%s': %s\n", tarName, strerror(errno));
freeHardLinkInfo(&tbInfo.hlInfoHead);
return ( FALSE);
}
@@ -1122,7 +1122,7 @@ static int writeTarFile(const char* tarName, int verboseFlag, char **argv,
/* Store the stat info for the tarball's file, so
* can avoid including the tarball into itself.... */
if (fstat(tbInfo.tarFd, &tbInfo.statBuf) < 0)
- fatalError(io_error, tarName, strerror(errno));
+ error_msg_and_die(io_error, tarName, strerror(errno));
/* Set the umask for this process so it doesn't
* screw up permission setting for us later. */
@@ -1130,7 +1130,7 @@ static int writeTarFile(const char* tarName, int verboseFlag, char **argv,
/* Read the directory/files and iterate over them one at a time */
while (*argv != NULL) {
- if (recursiveAction(*argv++, TRUE, FALSE, FALSE,
+ if (recursive_action(*argv++, TRUE, FALSE, FALSE,
writeFileToTarball, writeFileToTarball,
(void*) &tbInfo) == FALSE) {
errorFlag = TRUE;
@@ -1149,7 +1149,7 @@ static int writeTarFile(const char* tarName, int verboseFlag, char **argv,
/* Hang up the tools, close up shop, head home */
close(tarFd);
if (errorFlag == TRUE) {
- errorMsg("Error exit delayed from previous errors\n");
+ error_msg("Error exit delayed from previous errors\n");
freeHardLinkInfo(&tbInfo.hlInfoHead);
return(FALSE);
}