mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-02-09 00:00:04 +03:00
cmd_attr: check for errors from fdopendir()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
039fd4064a
commit
76161e0687
@ -16,6 +16,11 @@ static void propagate_recurse(int dirfd)
|
|||||||
DIR *dir = fdopendir(dirfd);
|
DIR *dir = fdopendir(dirfd);
|
||||||
struct dirent *d;
|
struct dirent *d;
|
||||||
|
|
||||||
|
if (!dir) {
|
||||||
|
fprintf(stderr, "fdopendir() error: %m\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
while ((errno = 0), (d = readdir(dir))) {
|
while ((errno = 0), (d = readdir(dir))) {
|
||||||
if (!strcmp(d->d_name, ".") ||
|
if (!strcmp(d->d_name, ".") ||
|
||||||
!strcmp(d->d_name, ".."))
|
!strcmp(d->d_name, ".."))
|
||||||
|
Loading…
Reference in New Issue
Block a user