From 788001cc457fd643dac0131e3d523c75e8fd8bd0 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Sun, 24 Feb 2013 09:46:42 +0100 Subject: [PATCH] Removes all the access() uses. --- mingw.c | 19 ------------------- mingw.h | 6 ------ scan.c | 6 ------ 3 files changed, 31 deletions(-) diff --git a/mingw.c b/mingw.c index 604a8306..94c291cb 100644 --- a/mingw.c +++ b/mingw.c @@ -546,25 +546,6 @@ void windows_dirent_lstat(const struct windows_dirent* dd, struct windows_stat* windows_finddata2stat(&dd->d_data, st); } -int windows_access(const char* file, int mode) -{ - DWORD attr; - - /* Check only for existence */ - if (mode != F_OK) { - errno = ENOSYS; - return -1; - } - - attr = GetFileAttributesW(convert(file)); - if (attr == 0xFFFFFFFF) { - windows_errno(GetLastError()); - return -1; - } - - return 0; -} - int windows_mkdir(const char* file) { if (!CreateDirectoryW(convert(file), 0)) { diff --git a/mingw.h b/mingw.h index 71de748d..b16c8a6e 100644 --- a/mingw.h +++ b/mingw.h @@ -34,7 +34,6 @@ #define open_noatime windows_open #define stat windows_stat #define lstat windows_lstat -#define access windows_access #define off_t off64_t #define lseek lseek64 #define fstat windows_fstat @@ -112,11 +111,6 @@ int windows_lstat(const char* file, struct windows_stat* st); */ int windows_stat(const char* file, struct windows_stat* st); -/** - * Like the C access(). - */ -int windows_access(const char* file, int mode); - /** * Like the C mkdir(). */ diff --git a/scan.c b/scan.c index fe4841b1..c7aab6e8 100644 --- a/scan.c +++ b/scan.c @@ -603,12 +603,6 @@ static int scan_dir(struct snapraid_scan* scan, struct snapraid_state* state, in if (S_ISREG(st.st_mode)) { if (filter_path(&state->filterlist, disk->name, sub_next) == 0) { - /* check for read permission */ - if (access(path_next, R_OK) != 0) { - fprintf(stderr, "warning: Ignoring, for missing read permission, file '%s'\n", path_next); - continue; - } - #if HAVE_LSTAT_EX /* get inode info about the file, Windows needs an additional step */ /* also for hardlink, the real size of the file is read only with this function */