} else if (stat(index_dir, &st) < 0) {
if (errno == ENOENT) {
/* it'll be created later */
- } else if (errno == EACCES) {
+ } else if (ENOACCESS(errno)) {
e_error(parent_event, "%s",
eacces_error_get("stat", index_dir));
} else {
index->readonly = FALSE;
}
- if (index->fd == -1 && errno == EACCES) {
+ if (index->fd == -1 && ENOACCESS(errno)) {
index->fd = open(index->filepath, O_RDONLY);
index->readonly = TRUE;
}
return;
}
- if (errno == EACCES) {
+ if (ENOACCESS(errno)) {
function = t_strcut(function, '(');
if (strcmp(function, "creat") == 0 ||
str_begins_with(function, "file_dotlock_"))
} else {
file->fd = nfs_safe_open(file->filepath, O_RDONLY);
}
- if (file->fd == -1 && errno == EACCES) {
+ if (file->fd == -1 && ENOACCESS(errno)) {
file->fd = nfs_safe_open(file->filepath, O_RDONLY);
index->readonly = TRUE;
}