man: use default MANPATH of "/usr/man"; do not search paths twice
[oweals/busybox.git] / libbb / recursive_action.c
index fe9ba2eccaa7048ef880be282f7c40858b5dd30d..3ec596a35772d99bd677612080499ab44381f3bd 100644 (file)
  * 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;
 }