summaryrefslogtreecommitdiff
path: root/utility.c
diff options
context:
space:
mode:
authorMark Whitley2000-12-05 20:03:17 +0000
committerMark Whitley2000-12-05 20:03:17 +0000
commit4758368505c2951300650ddcc93de6c657b43d50 (patch)
tree6890d8b480bc1040cdb8b1921db9e604754d1630 /utility.c
parentcf61fe14aebf2b5f753261afdb9e03167b31a843 (diff)
downloadbusybox-4758368505c2951300650ddcc93de6c657b43d50.zip
busybox-4758368505c2951300650ddcc93de6c657b43d50.tar.gz
Fixed the comments to match the code and renamed the function to a (hopefully)
more descriptive name, and as per the style guide.
Diffstat (limited to 'utility.c')
-rw-r--r--utility.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/utility.c b/utility.c
index eb33383..52a2eb7 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);