mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 19:01:57 -04:00
Removes all the access() uses.
This commit is contained in:
parent
afd4120622
commit
788001cc45
3 changed files with 0 additions and 31 deletions
19
mingw.c
19
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)) {
|
||||
|
|
|
|||
6
mingw.h
6
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().
|
||||
*/
|
||||
|
|
|
|||
6
scan.c
6
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 */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue