Skip to content

Commit

Permalink
MDEV-8743: use O_CLOEXEC (innodb/xtradb)
Browse files Browse the repository at this point in the history
  • Loading branch information
grooverdan committed Mar 1, 2018
1 parent 7cec685 commit 9629bca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions storage/innobase/os/os0file.c
Original file line number Diff line number Diff line change
Expand Up @@ -1184,10 +1184,10 @@ os_file_create_simple_func(
}

if (create_mode == OS_FILE_CREATE) {
file = open(name, create_flag, S_IRUSR | S_IWUSR
file = open(name, create_flag | O_CLOEXEC, S_IRUSR | S_IWUSR
| S_IRGRP | S_IWGRP);
} else {
file = open(name, create_flag);
file = open(name, create_flag | O_CLOEXEC);
}

if (file == -1) {
Expand Down Expand Up @@ -1631,7 +1631,7 @@ os_file_create_func(
}
#endif /* O_SYNC */

file = open(name, create_flag, os_innodb_umask);
file = open(name, create_flag | O_CLOEXEC, os_innodb_umask);

if (file == -1) {
*success = FALSE;
Expand Down
6 changes: 3 additions & 3 deletions storage/xtradb/os/os0file.c
Original file line number Diff line number Diff line change
Expand Up @@ -1286,10 +1286,10 @@ os_file_create_simple_func(
}

if (create_mode == OS_FILE_CREATE) {
file = open(name, create_flag, S_IRUSR | S_IWUSR
file = open(name, create_flag | O_CLOEXEC, S_IRUSR | S_IWUSR
| S_IRGRP | S_IWGRP);
} else {
file = open(name, create_flag);
file = open(name, create_flag | O_CLOEXEC);
}

if (file == -1) {
Expand Down Expand Up @@ -1752,7 +1752,7 @@ os_file_create_func(
}
#endif /* O_SYNC */

file = open(name, create_flag, os_innodb_umask);
file = open(name, create_flag | O_CLOEXEC, os_innodb_umask);

if (file == -1) {
*success = FALSE;
Expand Down

0 comments on commit 9629bca

Please sign in to comment.