Uses O_NOATIME if possible.

This commit is contained in:
Andrea Mazzoleni 2012-11-03 23:57:12 +01:00
parent 8f4e5e88a3
commit db6ff47062
6 changed files with 22 additions and 9 deletions

View file

@ -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 */