X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=libbb%2Frecursive_action.c;h=3ec596a35772d99bd677612080499ab44381f3bd;hb=e357d2ae6833e3ca306f3aa6e12c6ddf2ff1eae2;hp=fe9ba2eccaa7048ef880be282f7c40858b5dd30d;hpb=2649f215aecf923713d2f9a379cf651437ddf499;p=oweals%2Fbusybox.git diff --git a/libbb/recursive_action.c b/libbb/recursive_action.c index fe9ba2ecc..3ec596a35 100644 --- a/libbb/recursive_action.c +++ b/libbb/recursive_action.c @@ -22,10 +22,10 @@ * is so stinking huge. */ -static int true_action(const char *fileName ATTRIBUTE_UNUSED, - struct stat *statbuf ATTRIBUTE_UNUSED, - void* userData ATTRIBUTE_UNUSED, - int depth ATTRIBUTE_UNUSED) +static int FAST_FUNC true_action(const char *fileName UNUSED_PARAM, + struct stat *statbuf UNUSED_PARAM, + void* userData UNUSED_PARAM, + int depth UNUSED_PARAM) { return TRUE; } @@ -53,10 +53,10 @@ static int true_action(const char *fileName ATTRIBUTE_UNUSED, * 1: stat(statbuf). Calls dirAction and optionally recurse on link to dir. */ -int recursive_action(const char *fileName, +int FAST_FUNC recursive_action(const char *fileName, unsigned flags, - int (*fileAction)(const char *fileName, struct stat *statbuf, void* userData, int depth), - int (*dirAction)(const char *fileName, struct stat *statbuf, void* userData, int depth), + int FAST_FUNC (*fileAction)(const char *fileName, struct stat *statbuf, void* userData, int depth), + int FAST_FUNC (*dirAction)(const char *fileName, struct stat *statbuf, void* userData, int depth), void* userData, unsigned depth) { @@ -120,7 +120,16 @@ int recursive_action(const char *fileName, if (!recursive_action(nextFile, flags, fileAction, dirAction, userData, depth + 1)) status = FALSE; +// s = recursive_action(nextFile, flags, fileAction, dirAction, +// userData, depth + 1); free(nextFile); +//#define RECURSE_RESULT_ABORT 3 +// if (s == RECURSE_RESULT_ABORT) { +// closedir(dir); +// return s; +// } +// if (s == FALSE) +// status = FALSE; } closedir(dir); @@ -132,6 +141,7 @@ int recursive_action(const char *fileName, return status; done_nak_warn: - bb_simple_perror_msg(fileName); + if (!(flags & ACTION_QUIET)) + bb_simple_perror_msg(fileName); return FALSE; }