From 6f365c30eb33c40193defb827b03a8fd293bfc23 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 28 Nov 2011 09:56:03 +0100 Subject: mapper: check "r" permission on music directory Yet another common support case. --- src/mapper.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/mapper.c') diff --git a/src/mapper.c b/src/mapper.c index 41ed6550b..3cee41eb3 100644 --- a/src/mapper.c +++ b/src/mapper.c @@ -34,6 +34,7 @@ #include #include #include +#include static char *music_dir; static size_t music_dir_length; @@ -76,6 +77,12 @@ check_directory(const char *path) path); g_free(x); #endif + + DIR *dir = opendir(path); + if (dir == NULL && errno == EACCES) + g_warning("No permission to read directory: %s", path); + else + closedir(dir); } static void -- cgit v1.2.3