diff options
author | Eric Andersen <andersen@codepoet.org> | 1999-10-22 05:12:14 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 1999-10-22 05:12:14 +0000 |
commit | 63a0e530bd535cff8bc56cb51258102285581046 (patch) | |
tree | 4d4462cbeb705e91a726b7de7f801270c19e7a0e | |
parent | aa0765e11bdeba5c5abf745369a8430c8311d60c (diff) | |
download | busybox-w32-63a0e530bd535cff8bc56cb51258102285581046.tar.gz busybox-w32-63a0e530bd535cff8bc56cb51258102285581046.tar.bz2 busybox-w32-63a0e530bd535cff8bc56cb51258102285581046.zip |
Cosmetic adjustments.
-rw-r--r-- | internal.h | 2 | ||||
-rw-r--r-- | utility.c | 12 |
2 files changed, 8 insertions, 6 deletions
diff --git a/internal.h b/internal.h index cc7bfca11..0caaf5cb4 100644 --- a/internal.h +++ b/internal.h | |||
@@ -127,7 +127,7 @@ char *chunkstrdup(const char *str); | |||
127 | void freeChunks(void); | 127 | void freeChunks(void); |
128 | int fullWrite(int fd, const char *buf, int len); | 128 | int fullWrite(int fd, const char *buf, int len); |
129 | int fullRead(int fd, char *buf, int len); | 129 | int fullRead(int fd, char *buf, int len); |
130 | int recursiveAction(const char *fileName, int recurse, int followLinks, int delayDirAction, | 130 | int recursiveAction(const char *fileName, int recurse, int followLinks, int depthFirst, |
131 | int (*fileAction) (const char *fileName, struct stat* statbuf), | 131 | int (*fileAction) (const char *fileName, struct stat* statbuf), |
132 | int (*dirAction) (const char *fileName, struct stat* statbuf)); | 132 | int (*dirAction) (const char *fileName, struct stat* statbuf)); |
133 | const char* timeString(time_t timeVal); | 133 | const char* timeString(time_t timeVal); |
@@ -381,10 +381,12 @@ int fullRead(int fd, char *buf, int len) | |||
381 | * location, and do something (something specified | 381 | * location, and do something (something specified |
382 | * by the fileAction and dirAction function pointers). | 382 | * by the fileAction and dirAction function pointers). |
383 | * | 383 | * |
384 | * TODO: check if ftw(3) can replace this to reduce code size... | 384 | * Unfortunatly, while nftw(3) could replace this and reduce |
385 | * code size a bit, nftw() wasn't supported before GNU libc 2.1, | ||
386 | * and so isn't sufficiently portable to take over... | ||
385 | */ | 387 | */ |
386 | int | 388 | int |
387 | recursiveAction(const char *fileName, int recurse, int followLinks, int delayDirAction, | 389 | recursiveAction(const char *fileName, int recurse, int followLinks, int depthFirst, |
388 | int (*fileAction) (const char *fileName, struct stat* statbuf), | 390 | int (*fileAction) (const char *fileName, struct stat* statbuf), |
389 | int (*dirAction) (const char *fileName, struct stat* statbuf)) | 391 | int (*dirAction) (const char *fileName, struct stat* statbuf)) |
390 | { | 392 | { |
@@ -418,7 +420,7 @@ recursiveAction(const char *fileName, int recurse, int followLinks, int delayDir | |||
418 | perror(fileName); | 420 | perror(fileName); |
419 | return (FALSE); | 421 | return (FALSE); |
420 | } | 422 | } |
421 | if (dirAction != NULL && delayDirAction == FALSE) { | 423 | if (dirAction != NULL && depthFirst == FALSE) { |
422 | status = dirAction(fileName, &statbuf); | 424 | status = dirAction(fileName, &statbuf); |
423 | if (status == FALSE) { | 425 | if (status == FALSE) { |
424 | perror(fileName); | 426 | perror(fileName); |
@@ -433,7 +435,7 @@ recursiveAction(const char *fileName, int recurse, int followLinks, int delayDir | |||
433 | } | 435 | } |
434 | sprintf(nextFile, "%s/%s", fileName, next->d_name); | 436 | sprintf(nextFile, "%s/%s", fileName, next->d_name); |
435 | status = | 437 | status = |
436 | recursiveAction(nextFile, TRUE, followLinks, delayDirAction, | 438 | recursiveAction(nextFile, TRUE, followLinks, depthFirst, |
437 | fileAction, dirAction); | 439 | fileAction, dirAction); |
438 | if (status < 0) { | 440 | if (status < 0) { |
439 | closedir(dir); | 441 | closedir(dir); |
@@ -445,7 +447,7 @@ recursiveAction(const char *fileName, int recurse, int followLinks, int delayDir | |||
445 | perror(fileName); | 447 | perror(fileName); |
446 | return (FALSE); | 448 | return (FALSE); |
447 | } | 449 | } |
448 | if (dirAction != NULL && delayDirAction == TRUE) { | 450 | if (dirAction != NULL && depthFirst == TRUE) { |
449 | status = dirAction(fileName, &statbuf); | 451 | status = dirAction(fileName, &statbuf); |
450 | if (status == FALSE) { | 452 | if (status == FALSE) { |
451 | perror(fileName); | 453 | perror(fileName); |