summaryrefslogtreecommitdiff
path: root/lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/lib.c b/lib.c
index 2f5de70..0423c1b 100644
--- a/lib.c
+++ b/lib.c
@@ -185,18 +185,22 @@ for_each_subdir (char *path, error_t (*func) (char *, char *))
err = stat (name, &filestat);
- if (err)
- return err;
-
free (name);
+ if (err)
+ {
+ fprintf (stderr, "unionfs: couldn't stat %s%s\n",
+ path, (*dirent)->d_name);
+ continue;
+ }
+
if (!S_ISDIR(filestat.st_mode))
continue;
- err = func ((*dirent)->d_name, path);
+ func ((*dirent)->d_name, path);
}
- return err;
+ return 0;
}
error_t
@@ -228,18 +232,22 @@ for_each_subdir_priv (char *path, error_t (*func) (char *, char *, void *),
err = stat (name, &filestat);
- if (err)
- return err;
-
free (name);
+ if (err)
+ {
+ fprintf (stderr, "unionfs: couldn't stat %s%s\n",
+ path, (*dirent)->d_name);
+ continue;
+ }
+
if (!S_ISDIR(filestat.st_mode))
continue;
func ((*dirent)->d_name, path, priv);
}
- return err;
+ return 0;
}
error_t