aboutsummaryrefslogtreecommitdiffstats
path: root/src/msec_find
diff options
context:
space:
mode:
authorEugeni Dodonov <eugeni@mandriva.org>2010-02-22 17:35:25 +0000
committerEugeni Dodonov <eugeni@mandriva.org>2010-02-22 17:35:25 +0000
commit9afb181fef625f8ad00b0011a4f2b2e1dce8eb29 (patch)
tree329f8cc743d2d6cfe5797b54adead995ed6e1da9 /src/msec_find
parenta82fa2461aa16a1170349095dd3f37bac056e39e (diff)
downloadmsec-9afb181fef625f8ad00b0011a4f2b2e1dce8eb29.tar
msec-9afb181fef625f8ad00b0011a4f2b2e1dce8eb29.tar.gz
msec-9afb181fef625f8ad00b0011a4f2b2e1dce8eb29.tar.bz2
msec-9afb181fef625f8ad00b0011a4f2b2e1dce8eb29.tar.xz
msec-9afb181fef625f8ad00b0011a4f2b2e1dce8eb29.zip
Do not check subtrees of excluded entries
Diffstat (limited to 'src/msec_find')
-rw-r--r--src/msec_find/find.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/msec_find/find.c b/src/msec_find/find.c
index 3959ea9..a4ecff7 100644
--- a/src/msec_find/find.c
+++ b/src/msec_find/find.c
@@ -37,6 +37,7 @@
#include <stdio.h>
#define __USE_XOPEN_EXTENDED
+#define __USE_GNU
#include <ftw.h>
#include <sys/stat.h>
@@ -85,11 +86,10 @@ static int traverse(const char *file, const struct stat *sb, int flag, struct FT
if ( (strncmp("/proc", file, 5) == 0) ||
(strncmp("/dev", file, 4) == 0) ||
(strncmp("/sys", file, 4) == 0) )
- return 0;
+ return FTW_SKIP_SUBTREE;
- if (use_regexp && (regexec(&exclude_regexp, file, 0, NULL, 0) == 0)) {
- return 0;
- }
+ if (use_regexp && (regexec(&exclude_regexp, file, 0, NULL, 0) == 0))
+ return FTW_SKIP_SUBTREE;
switch (flag) {
/*
@@ -223,7 +223,7 @@ int main(int argc, char **argv)
directory = argv[i];
}
- res = nftw(directory, traverse, 200, FTW_PHYS | FTW_MOUNT);
+ res = nftw(directory, traverse, 200, FTW_PHYS | FTW_MOUNT | FTW_ACTIONRETVAL);
if ( ctrl ) {
free(directory);