aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ar.c4
-rw-r--r--archival/ar.c4
-rw-r--r--busybox.h2
-rw-r--r--include/busybox.h2
-rw-r--r--utility.c18
5 files changed, 15 insertions, 15 deletions
diff --git a/ar.c b/ar.c
index 0f16ec88c..a9a0a0a71 100644
--- a/ar.c
+++ b/ar.c
@@ -372,11 +372,11 @@ extern int ar_main(int argc, char **argv)
createPath(extractList->name, 0666);
dstFd = open(extractList->name, O_WRONLY | O_CREAT, extractList->mode);
lseek(srcFd, extractList->offset, SEEK_SET);
- copySubFile(srcFd, dstFd, (size_t) extractList->size);
+ copy_file_chunk(srcFd, dstFd, (size_t) extractList->size);
}
if (funct & EXT_TO_STDOUT) {
lseek(srcFd, extractList->offset, SEEK_SET);
- copySubFile(srcFd, fileno(stdout), (size_t) extractList->size);
+ copy_file_chunk(srcFd, fileno(stdout), (size_t) extractList->size);
}
if ( (funct & DISPLAY) || (funct & VERBOSE)) {
if (funct & VERBOSE)
diff --git a/archival/ar.c b/archival/ar.c
index 0f16ec88c..a9a0a0a71 100644
--- a/archival/ar.c
+++ b/archival/ar.c
@@ -372,11 +372,11 @@ extern int ar_main(int argc, char **argv)
createPath(extractList->name, 0666);
dstFd = open(extractList->name, O_WRONLY | O_CREAT, extractList->mode);
lseek(srcFd, extractList->offset, SEEK_SET);
- copySubFile(srcFd, dstFd, (size_t) extractList->size);
+ copy_file_chunk(srcFd, dstFd, (size_t) extractList->size);
}
if (funct & EXT_TO_STDOUT) {
lseek(srcFd, extractList->offset, SEEK_SET);
- copySubFile(srcFd, fileno(stdout), (size_t) extractList->size);
+ copy_file_chunk(srcFd, fileno(stdout), (size_t) extractList->size);
}
if ( (funct & DISPLAY) || (funct & VERBOSE)) {
if (funct & VERBOSE)
diff --git a/busybox.h b/busybox.h
index 4a4f44aea..21c62faac 100644
--- a/busybox.h
+++ b/busybox.h
@@ -144,7 +144,7 @@ void reset_ino_dev_hashtable(void);
int copyFile(const char *srcName, const char *destName,
int setModes, int followLinks, int forceFlag);
-int copySubFile(int srcFd, int dstFd, size_t remaining);
+int copy_file_chunk(int srcFd, int dstFd, size_t remaining);
char *buildName(const char *dirName, const char *fileName);
int makeString(int argc, const char **argv, char *buf, int bufLen);
char *getChunk(int size);
diff --git a/include/busybox.h b/include/busybox.h
index 4a4f44aea..21c62faac 100644
--- a/include/busybox.h
+++ b/include/busybox.h
@@ -144,7 +144,7 @@ void reset_ino_dev_hashtable(void);
int copyFile(const char *srcName, const char *destName,
int setModes, int followLinks, int forceFlag);
-int copySubFile(int srcFd, int dstFd, size_t remaining);
+int copy_file_chunk(int srcFd, int dstFd, size_t remaining);
char *buildName(const char *dirName, const char *fileName);
int makeString(int argc, const char **argv, char *buf, int bufLen);
char *getChunk(int size);
diff --git a/utility.c b/utility.c
index eb3338302..52a2eb7c2 100644
--- a/utility.c
+++ b/utility.c
@@ -296,21 +296,21 @@ int isDirectory(const char *fileName, const int followLinks, struct stat *statBu
#if defined (BB_AR) || defined BB_CP_MV
/*
- * Copy readSize bytes between two file descriptors
+ * Copy chunksize bytes between two file descriptors
*/
-int copySubFile(int srcFd, int dstFd, size_t remaining)
+int copy_file_chunk(int srcfd, int dstfd, size_t chunksize)
{
size_t size;
- char buffer[BUFSIZ];
+ char buffer[BUFSIZ]; /* BUFSIZ is declared in stdio.h */
- while (remaining > 0) {
- if (remaining > BUFSIZ)
+ while (chunksize > 0) {
+ if (chunksize > BUFSIZ)
size = BUFSIZ;
else
- size = remaining;
- if (fullWrite(dstFd, buffer, fullRead(srcFd, buffer, size)) < size)
+ size = chunksize;
+ if (fullWrite(dstfd, buffer, fullRead(srcfd, buffer, size)) < size)
return(FALSE);
- remaining -= size;
+ chunksize -= size;
}
return (TRUE);
}
@@ -423,7 +423,7 @@ copyFile(const char *srcName, const char *destName,
return FALSE;
}
- if (copySubFile(rfd, wfd, srcStatBuf.st_size)==FALSE)
+ if (copy_file_chunk(rfd, wfd, srcStatBuf.st_size)==FALSE)
goto error_exit;
close(rfd);