Skip to content

Commit 24b3531

Browse files
committed
Merge branch '10.0-galera' into 10.1
2 parents f538a64 + 8b54c31 commit 24b3531

File tree

5 files changed

+35
-4
lines changed

5 files changed

+35
-4
lines changed

cmake/wsrep.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ ENDIF()
2626
OPTION(WITH_WSREP "WSREP replication API (to use, e.g. Galera Replication library)" ${with_wsrep_default})
2727

2828
# Set the patch version
29-
SET(WSREP_PATCH_VERSION "21")
29+
SET(WSREP_PATCH_VERSION "23")
3030

3131
# Obtain wsrep API version
3232
FILE(STRINGS "${MySQL_SOURCE_DIR}/wsrep/wsrep_api.h" WSREP_API_VERSION

include/my_global.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,11 @@ typedef SOCKET_SIZE_TYPE size_socket;
593593
#ifndef O_CLOEXEC
594594
#define O_CLOEXEC 0
595595
#endif
596+
#ifdef __GLIBC__
597+
#define STR_O_CLOEXEC "e"
598+
#else
599+
#define STR_O_CLOEXEC ""
600+
#endif
596601
#ifndef SOCK_CLOEXEC
597602
#define SOCK_CLOEXEC 0
598603
#endif

storage/innobase/buf/buf0dump.cc

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,20 @@ buf_dump(
216216
buf_dump_status(STATUS_NOTICE, "Dumping buffer pool(s) to %s",
217217
full_filename);
218218

219-
f = fopen(tmp_filename, "w");
219+
#if defined(__GLIBC__) || defined(__WIN__) || O_CLOEXEC == 0
220+
f = fopen(tmp_filename, "w" STR_O_CLOEXEC);
221+
#else
222+
{
223+
int fd;
224+
fd = open(tmp_filename, O_CREAT | O_TRUNC | O_CLOEXEC | O_WRONLY, 0640);
225+
if (fd >= 0) {
226+
f = fdopen(fd, "w");
227+
}
228+
else {
229+
f = NULL;
230+
}
231+
}
232+
#endif
220233
if (f == NULL) {
221234
buf_dump_status(STATUS_ERR,
222235
"Cannot open '%s' for writing: %s",

storage/innobase/os/os0file.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3851,7 +3851,7 @@ os_aio_native_aio_supported(void)
38513851

38523852
strcpy(name + dirnamelen, "ib_logfile0");
38533853

3854-
fd = ::open(name, O_RDONLY);
3854+
fd = ::open(name, O_RDONLY | O_CLOEXEC);
38553855

38563856
if (fd == -1) {
38573857

storage/xtradb/buf/buf0dump.cc

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,20 @@ buf_dump(
216216
buf_dump_status(STATUS_NOTICE, "Dumping buffer pool(s) to %s",
217217
full_filename);
218218

219-
f = fopen(tmp_filename, "w");
219+
#if defined(__GLIBC__) || defined(__WIN__) || O_CLOEXEC == 0
220+
f = fopen(tmp_filename, "w" STR_O_CLOEXEC);
221+
#else
222+
{
223+
int fd;
224+
fd = open(tmp_filename, O_CREAT | O_TRUNC | O_CLOEXEC | O_WRONLY, 0640);
225+
if (fd >= 0) {
226+
f = fdopen(fd, "w");
227+
}
228+
else {
229+
f = NULL;
230+
}
231+
}
232+
#endif
220233
if (f == NULL) {
221234
buf_dump_status(STATUS_ERR,
222235
"Cannot open '%s' for writing: %s",

0 commit comments

Comments
 (0)