If O_NOATIME use fails with EPERM, retry without it.

This commit is contained in:
Andrea Mazzoleni 2012-11-04 00:26:30 +01:00
parent db6ff47062
commit 2d6528fe90
4 changed files with 25 additions and 14 deletions

View file

@ -1002,7 +1002,7 @@ static int state_check_process(struct snapraid_state* state, int check, int fix,
}
/* create it */
/* do not follow links to ensure to open the real file */
/* O_NOFOLLOW: do not follow links to ensure to open the real file */
f = open(path, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY | O_NOFOLLOW, 0600);
if (f == -1) {
fprintf(stderr, "Error creating empty file '%s'. %s.\n", path, strerror(errno));