diff --git a/src/task_find.bpf.c b/src/task_find.bpf.c index 73d3cd210f51c848203a3c093248524b6530db90..e1f395ad18760fc02b499822039f7fc07ede8b8c 100644 --- a/src/task_find.bpf.c +++ b/src/task_find.bpf.c @@ -44,7 +44,7 @@ static long iter_dir(uint32_t d_type, size_t namelen, bool match) { err = -1; goto end; } - int parent_dfd = dfd[depth]; + int parent_dfd = dfd[0]; /* void *name_user = u_iterdents64_buf + depth * PATHLEN; */ void *name_user = u_iterdents64_buf; @@ -89,8 +89,9 @@ static long iter_dir(uint32_t d_type, size_t namelen, bool match) { void *child_name_user = name_user; curr_depth = child_depth; - dfd[curr_depth] = child_dfd; + dfd[0] = child_dfd; err = bpf_task_iterdents64(child_dfd, pdpf, child_name_user, PATHLEN); + dfd[0] = parent_dfd; if (err) { bpf_printk("Error: iterdents64(%d, %d) = %d", child_dfd, pdpf, err); goto reset_depth;