mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-30 03:47:05 -05:00
Uses O_NOATIME if possible.
This commit is contained in:
parent
8f4e5e88a3
commit
db6ff47062
6 changed files with 22 additions and 9 deletions
4
handle.c
4
handle.c
|
|
@ -87,7 +87,7 @@ int handle_create(struct snapraid_handle* handle, struct snapraid_file* file)
|
|||
/* if failed for missing permission */
|
||||
if (handle->f == -1 && errno == EACCES) {
|
||||
/* retry without requesting write permission */
|
||||
handle->f = open(handle->path, O_RDONLY | O_BINARY | O_SEQUENTIAL | O_NOFOLLOW);
|
||||
handle->f = open(handle->path, O_RDONLY | O_BINARY | O_SEQUENTIAL | O_NOFOLLOW | O_NOATIME);
|
||||
}
|
||||
|
||||
if (handle->f == -1) {
|
||||
|
|
@ -161,7 +161,7 @@ int handle_open(struct snapraid_handle* handle, struct snapraid_file* file)
|
|||
|
||||
/* opening in sequential mode in Windows */
|
||||
/* do not follow links to ensure to open the real file */
|
||||
handle->f = open(handle->path, O_RDONLY | O_BINARY | O_SEQUENTIAL | O_NOFOLLOW);
|
||||
handle->f = open(handle->path, O_RDONLY | O_BINARY | O_SEQUENTIAL | O_NOFOLLOW | O_NOATIME);
|
||||
|
||||
if (handle->f == -1) {
|
||||
/* invalidate for error */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue