diff options
Diffstat (limited to 'lib.c')
-rw-r--r-- | lib.c | 26 |
1 files changed, 17 insertions, 9 deletions
@@ -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 |