summaryrefslogtreecommitdiff
path: root/storage/maria
diff options
context:
space:
mode:
authorVicențiu Ciorbaru <vicentiu@mariadb.org>2018-06-12 19:39:37 +0300
committerVicențiu Ciorbaru <vicentiu@mariadb.org>2018-06-12 19:39:37 +0300
commit6e55236c0a72e8f49a240c4e080591994042b0e4 (patch)
tree4bb2f438004db3dbba5f88f5e4b00aacfd5c1cec /storage/maria
parentaa59ecec89d89a29f7272352471a4064aa6db28c (diff)
parent215d652c66474c4578b0476385d055e7feae2d3a (diff)
downloadmariadb-git-6e55236c0a72e8f49a240c4e080591994042b0e4.tar.gz
Merge branch '10.0-galera' into 10.1
Diffstat (limited to 'storage/maria')
-rw-r--r--storage/maria/ma_control_file.c2
-rw-r--r--storage/maria/ma_loghandler.c6
-rw-r--r--storage/maria/ma_open.c8
3 files changed, 8 insertions, 8 deletions
diff --git a/storage/maria/ma_control_file.c b/storage/maria/ma_control_file.c
index b46cf7e1765..f037589db29 100644
--- a/storage/maria/ma_control_file.c
+++ b/storage/maria/ma_control_file.c
@@ -273,7 +273,7 @@ CONTROL_FILE_ERROR ma_control_file_open(my_bool create_if_missing,
" file is probably in use by another process";
uint new_cf_create_time_size, new_cf_changeable_size, new_block_size;
my_off_t file_size;
- int open_flags= O_BINARY | /*O_DIRECT |*/ O_RDWR;
+ int open_flags= O_BINARY | /*O_DIRECT |*/ O_RDWR | O_CLOEXEC;
int error= CONTROL_FILE_UNKNOWN_ERROR;
DBUG_ENTER("ma_control_file_open");
diff --git a/storage/maria/ma_loghandler.c b/storage/maria/ma_loghandler.c
index 129770249aa..aa7ff9da7f2 100644
--- a/storage/maria/ma_loghandler.c
+++ b/storage/maria/ma_loghandler.c
@@ -935,7 +935,7 @@ static File create_logfile_by_number_no_cache(uint32 file_no)
/* TODO: add O_DIRECT to open flags (when buffer is aligned) */
if ((file= mysql_file_create(key_file_translog,
translog_filename_by_fileno(file_no, path),
- 0, O_BINARY | O_RDWR, MYF(MY_WME))) < 0)
+ 0, O_BINARY | O_RDWR | O_CLOEXEC, MYF(MY_WME))) < 0)
{
DBUG_PRINT("error", ("Error %d during creating file '%s'", errno, path));
translog_stop_writing();
@@ -973,7 +973,7 @@ static File open_logfile_by_number_no_cache(uint32 file_no)
/* TODO: use mysql_file_create() */
if ((file= mysql_file_open(key_file_translog,
translog_filename_by_fileno(file_no, path),
- log_descriptor.open_flags,
+ log_descriptor.open_flags | O_CLOEXEC,
MYF(MY_WME))) < 0)
{
DBUG_PRINT("error", ("Error %d during opening file '%s'", errno, path));
@@ -3243,7 +3243,7 @@ static my_bool translog_get_last_page_addr(TRANSLOG_ADDRESS *addr,
File fd;
if ((fd= mysql_file_open(key_file_translog,
translog_filename_by_fileno(file_no, path),
- O_RDONLY, (no_errors ? MYF(0) : MYF(MY_WME)))) < 0)
+ O_RDONLY | O_CLOEXEC, (no_errors ? MYF(0) : MYF(MY_WME)))) < 0)
{
my_errno= errno;
DBUG_PRINT("error", ("Error %d during opening file #%d",
diff --git a/storage/maria/ma_open.c b/storage/maria/ma_open.c
index 27a85142f6b..598f76a6472 100644
--- a/storage/maria/ma_open.c
+++ b/storage/maria/ma_open.c
@@ -334,13 +334,13 @@ MARIA_HA *maria_open(const char *name, int mode, uint open_flags)
});
DEBUG_SYNC_C("mi_open_kfile");
if ((kfile=mysql_file_open(key_file_kfile, name_buff,
- (open_mode=O_RDWR) | O_SHARE | O_NOFOLLOW,
+ (open_mode=O_RDWR) | O_SHARE | O_NOFOLLOW | O_CLOEXEC,
MYF(MY_NOSYMLINKS))) < 0)
{
if ((errno != EROFS && errno != EACCES) ||
mode != O_RDONLY ||
(kfile=mysql_file_open(key_file_kfile, name_buff,
- (open_mode=O_RDONLY) | O_SHARE | O_NOFOLLOW,
+ (open_mode=O_RDONLY) | O_SHARE | O_NOFOLLOW | O_CLOEXEC,
MYF(MY_NOSYMLINKS))) < 0)
goto err;
}
@@ -1942,7 +1942,7 @@ int _ma_open_datafile(MARIA_HA *info, MARIA_SHARE *share)
DEBUG_SYNC_C("mi_open_datafile");
info->dfile.file= share->bitmap.file.file=
mysql_file_open(key_file_dfile, share->data_file_name.str,
- share->mode | O_SHARE, MYF(flags));
+ share->mode | O_SHARE | O_CLOEXEC, MYF(flags));
return info->dfile.file >= 0 ? 0 : 1;
}
@@ -1956,7 +1956,7 @@ int _ma_open_keyfile(MARIA_SHARE *share)
mysql_mutex_lock(&share->intern_lock);
share->kfile.file= mysql_file_open(key_file_kfile,
share->unique_file_name.str,
- share->mode | O_SHARE | O_NOFOLLOW,
+ share->mode | O_SHARE | O_NOFOLLOW | O_CLOEXEC,
MYF(MY_WME | MY_NOSYMLINKS));
mysql_mutex_unlock(&share->intern_lock);
return (share->kfile.file < 0);