From 5030481050eeccb65643d849d6fb06d005f47c93 Mon Sep 17 00:00:00 2001 From: Gianluca Guida Date: Mon, 30 May 2005 12:53:20 +0000 Subject: New README and bugfixes. --- lib.c | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'lib.c') 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 -- cgit v1.2.3