mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 19:01:57 -04:00
If O_NOATIME use fails with EPERM, retry without it.
This commit is contained in:
parent
db6ff47062
commit
2d6528fe90
4 changed files with 25 additions and 14 deletions
6
parity.c
6
parity.c
|
|
@ -221,8 +221,10 @@ int parity_open(struct snapraid_parity* parity, const char* path)
|
|||
|
||||
pathcpy(parity->path, sizeof(parity->path), path);
|
||||
|
||||
/* opening in sequential mode in Windows */
|
||||
parity->f = open(parity->path, O_RDONLY | O_BINARY | O_SEQUENTIAL | O_NOATIME);
|
||||
/* open for read */
|
||||
/* O_SEQUENTIAL: opening in sequential mode in Windows */
|
||||
/* O_NOATIME: do not change access time */
|
||||
parity->f = open_noatime(parity->path, O_RDONLY | O_BINARY | O_SEQUENTIAL);
|
||||
if (parity->f == -1) {
|
||||
fprintf(stderr, "Error opening parity file '%s'. %s.\n", parity->path, strerror(errno));
|
||||
return -1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue