summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd_attr.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/cmd_attr.c b/cmd_attr.c
index 9e7f5639..bde9d8f6 100644
--- a/cmd_attr.c
+++ b/cmd_attr.c
@@ -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, ".."))