summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Whitley <markw@lineo.com>2000-12-05 20:03:17 +0000
committerMark Whitley <markw@lineo.com>2000-12-05 20:03:17 +0000
commit4758368505c2951300650ddcc93de6c657b43d50 (patch)
tree6890d8b480bc1040cdb8b1921db9e604754d1630
parentcf61fe14aebf2b5f753261afdb9e03167b31a843 (diff)
downloadbusybox-w32-4758368505c2951300650ddcc93de6c657b43d50.tar.gz
busybox-w32-4758368505c2951300650ddcc93de6c657b43d50.tar.bz2
busybox-w32-4758368505c2951300650ddcc93de6c657b43d50.zip
Fixed the comments to match the code and renamed the function to a (hopefully)
more descriptive name, and as per the style guide.
-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)
372 createPath(extractList->name, 0666); 372 createPath(extractList->name, 0666);
373 dstFd = open(extractList->name, O_WRONLY | O_CREAT, extractList->mode); 373 dstFd = open(extractList->name, O_WRONLY | O_CREAT, extractList->mode);
374 lseek(srcFd, extractList->offset, SEEK_SET); 374 lseek(srcFd, extractList->offset, SEEK_SET);
375 copySubFile(srcFd, dstFd, (size_t) extractList->size); 375 copy_file_chunk(srcFd, dstFd, (size_t) extractList->size);
376 } 376 }
377 if (funct & EXT_TO_STDOUT) { 377 if (funct & EXT_TO_STDOUT) {
378 lseek(srcFd, extractList->offset, SEEK_SET); 378 lseek(srcFd, extractList->offset, SEEK_SET);
379 copySubFile(srcFd, fileno(stdout), (size_t) extractList->size); 379 copy_file_chunk(srcFd, fileno(stdout), (size_t) extractList->size);
380 } 380 }
381 if ( (funct & DISPLAY) || (funct & VERBOSE)) { 381 if ( (funct & DISPLAY) || (funct & VERBOSE)) {
382 if (funct & VERBOSE) 382 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)
372 createPath(extractList->name, 0666); 372 createPath(extractList->name, 0666);
373 dstFd = open(extractList->name, O_WRONLY | O_CREAT, extractList->mode); 373 dstFd = open(extractList->name, O_WRONLY | O_CREAT, extractList->mode);
374 lseek(srcFd, extractList->offset, SEEK_SET); 374 lseek(srcFd, extractList->offset, SEEK_SET);
375 copySubFile(srcFd, dstFd, (size_t) extractList->size); 375 copy_file_chunk(srcFd, dstFd, (size_t) extractList->size);
376 } 376 }
377 if (funct & EXT_TO_STDOUT) { 377 if (funct & EXT_TO_STDOUT) {
378 lseek(srcFd, extractList->offset, SEEK_SET); 378 lseek(srcFd, extractList->offset, SEEK_SET);
379 copySubFile(srcFd, fileno(stdout), (size_t) extractList->size); 379 copy_file_chunk(srcFd, fileno(stdout), (size_t) extractList->size);
380 } 380 }
381 if ( (funct & DISPLAY) || (funct & VERBOSE)) { 381 if ( (funct & DISPLAY) || (funct & VERBOSE)) {
382 if (funct & VERBOSE) 382 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);
144 144
145int copyFile(const char *srcName, const char *destName, 145int copyFile(const char *srcName, const char *destName,
146 int setModes, int followLinks, int forceFlag); 146 int setModes, int followLinks, int forceFlag);
147int copySubFile(int srcFd, int dstFd, size_t remaining); 147int copy_file_chunk(int srcFd, int dstFd, size_t remaining);
148char *buildName(const char *dirName, const char *fileName); 148char *buildName(const char *dirName, const char *fileName);
149int makeString(int argc, const char **argv, char *buf, int bufLen); 149int makeString(int argc, const char **argv, char *buf, int bufLen);
150char *getChunk(int size); 150char *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);
144 144
145int copyFile(const char *srcName, const char *destName, 145int copyFile(const char *srcName, const char *destName,
146 int setModes, int followLinks, int forceFlag); 146 int setModes, int followLinks, int forceFlag);
147int copySubFile(int srcFd, int dstFd, size_t remaining); 147int copy_file_chunk(int srcFd, int dstFd, size_t remaining);
148char *buildName(const char *dirName, const char *fileName); 148char *buildName(const char *dirName, const char *fileName);
149int makeString(int argc, const char **argv, char *buf, int bufLen); 149int makeString(int argc, const char **argv, char *buf, int bufLen);
150char *getChunk(int size); 150char *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
296 296
297#if defined (BB_AR) || defined BB_CP_MV 297#if defined (BB_AR) || defined BB_CP_MV
298/* 298/*
299 * Copy readSize bytes between two file descriptors 299 * Copy chunksize bytes between two file descriptors
300 */ 300 */
301int copySubFile(int srcFd, int dstFd, size_t remaining) 301int copy_file_chunk(int srcfd, int dstfd, size_t chunksize)
302{ 302{
303 size_t size; 303 size_t size;
304 char buffer[BUFSIZ]; 304 char buffer[BUFSIZ]; /* BUFSIZ is declared in stdio.h */
305 305
306 while (remaining > 0) { 306 while (chunksize > 0) {
307 if (remaining > BUFSIZ) 307 if (chunksize > BUFSIZ)
308 size = BUFSIZ; 308 size = BUFSIZ;
309 else 309 else
310 size = remaining; 310 size = chunksize;
311 if (fullWrite(dstFd, buffer, fullRead(srcFd, buffer, size)) < size) 311 if (fullWrite(dstfd, buffer, fullRead(srcfd, buffer, size)) < size)
312 return(FALSE); 312 return(FALSE);
313 remaining -= size; 313 chunksize -= size;
314 } 314 }
315 return (TRUE); 315 return (TRUE);
316} 316}
@@ -423,7 +423,7 @@ copyFile(const char *srcName, const char *destName,
423 return FALSE; 423 return FALSE;
424 } 424 }
425 425
426 if (copySubFile(rfd, wfd, srcStatBuf.st_size)==FALSE) 426 if (copy_file_chunk(rfd, wfd, srcStatBuf.st_size)==FALSE)
427 goto error_exit; 427 goto error_exit;
428 428
429 close(rfd); 429 close(rfd);