cmd_attr: check for errors from fdopendir()

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2024-01-15 14:34:54 -05:00
parent 039fd4064a
commit 76161e0687

View File

@ -16,6 +16,11 @@ static void propagate_recurse(int dirfd)
DIR *dir = fdopendir(dirfd);
struct dirent *d;
if (!dir) {
fprintf(stderr, "fdopendir() error: %m\n");
return;
}
while ((errno = 0), (d = readdir(dir))) {
if (!strcmp(d->d_name, ".") ||
!strcmp(d->d_name, ".."))