From dda4f7d1c1e419c08729b35a239ff85691c4503e Mon Sep 17 00:00:00 2001 From: Andreas Gruenbacher Date: Thu, 26 Jan 2006 04:16:35 +0000 Subject: - Also check for access(path, R_OK|X_OK) before visiting all the files in a directory: this avoids an error message for each file in a non-executable directory. --- lib/backup-files.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/backup-files.c b/lib/backup-files.c index f28e89c..caace72 100644 --- a/lib/backup-files.c +++ b/lib/backup-files.c @@ -384,7 +384,7 @@ foreachdir_rec(const char *path, struct stat *st, char *p = NULL; int failed = 0; - if (!(dir = opendir(path))) + if (access(path, R_OK|X_OK) || !(dir = opendir(path))) return walk(path, NULL); while ((dp = readdir(dir))) { char *p0 = p; -- cgit