Skip to content

Commit

Permalink
InnoDB: Use access() instead of open()
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Jul 5, 2017
1 parent 06041ad commit 41a6475
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions storage/innobase/os/os0file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3321,15 +3321,8 @@ os_file_get_status_posix(
&& (stat_info->type == OS_FILE_TYPE_FILE
|| stat_info->type == OS_FILE_TYPE_BLOCK)) {

int fh = open(path, read_only ? O_RDONLY : O_RDWR,
os_innodb_umask);

if (fh == -1) {
stat_info->rw_perm = false;
} else {
stat_info->rw_perm = true;
close(fh);
}
stat_info->rw_perm = !access(path, read_only
? R_OK : R_OK | W_OK);
}

return(DB_SUCCESS);
Expand Down

0 comments on commit 41a6475

Please sign in to comment.