Skip to content
Snippets Groups Projects
Commit 4398afbb authored by Luis Gerhorst's avatar Luis Gerhorst
Browse files

task_find: print every entry

parent e04ef376
No related branches found
No related tags found
No related merge requests found
...@@ -131,23 +131,20 @@ end: ...@@ -131,23 +131,20 @@ end:
SEC("iterdents64") SEC("iterdents64")
int process_dirent(struct bpf_dirent64 *d) { int process_dirent(struct bpf_dirent64 *d) {
int err = 0; int err = 0;
bool match = false;
/* Skip "." and "..": */ /* Skip "." and "..": */
if (!(d->name + 2 > (char *) d->name_end)) { if (!(d->name + 2 > (char *) d->name_end)) {
if (d->name[0] == '.' && d->namelen == 1) { if (d->name[0] == '.' && d->namelen == 1) {
goto end; goto end;
} }
match = d->name[0] == 'a';
} }
if (!(d->name + 3 > (char *) d->name_end)) { if (!(d->name + 3 > (char *) d->name_end)) {
if (d->name[0] == '.' && d->name[1] == '.' && d->namelen == 2) { if (d->name[0] == '.' && d->name[1] == '.' && d->namelen == 2) {
goto end; goto end;
} }
} }
err = iter_dir(d->d_type, d->namelen, match); err = iter_dir(d->d_type, d->namelen, true);
if (err) { if (err) {
goto end; goto end;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment