Commit 24b35316 authored by Vicențiu Ciorbaru's avatar Vicențiu Ciorbaru

Merge branch '10.0-galera' into 10.1

parents f538a648 8b54c314
......@@ -26,7 +26,7 @@ ENDIF()
OPTION(WITH_WSREP "WSREP replication API (to use, e.g. Galera Replication library)" ${with_wsrep_default})
# Set the patch version
SET(WSREP_PATCH_VERSION "21")
SET(WSREP_PATCH_VERSION "23")
# Obtain wsrep API version
FILE(STRINGS "${MySQL_SOURCE_DIR}/wsrep/wsrep_api.h" WSREP_API_VERSION
......
......@@ -593,6 +593,11 @@ typedef SOCKET_SIZE_TYPE size_socket;
#ifndef O_CLOEXEC
#define O_CLOEXEC 0
#endif
#ifdef __GLIBC__
#define STR_O_CLOEXEC "e"
#else
#define STR_O_CLOEXEC ""
#endif
#ifndef SOCK_CLOEXEC
#define SOCK_CLOEXEC 0
#endif
......
......@@ -216,7 +216,20 @@ buf_dump(
buf_dump_status(STATUS_NOTICE, "Dumping buffer pool(s) to %s",
full_filename);
f = fopen(tmp_filename, "w");
#if defined(__GLIBC__) || defined(__WIN__) || O_CLOEXEC == 0
f = fopen(tmp_filename, "w" STR_O_CLOEXEC);
#else
{
int fd;
fd = open(tmp_filename, O_CREAT | O_TRUNC | O_CLOEXEC | O_WRONLY, 0640);
if (fd >= 0) {
f = fdopen(fd, "w");
}
else {
f = NULL;
}
}
#endif
if (f == NULL) {
buf_dump_status(STATUS_ERR,
"Cannot open '%s' for writing: %s",
......
......@@ -3851,7 +3851,7 @@ os_aio_native_aio_supported(void)
strcpy(name + dirnamelen, "ib_logfile0");
fd = ::open(name, O_RDONLY);
fd = ::open(name, O_RDONLY | O_CLOEXEC);
if (fd == -1) {
......
......@@ -216,7 +216,20 @@ buf_dump(
buf_dump_status(STATUS_NOTICE, "Dumping buffer pool(s) to %s",
full_filename);
f = fopen(tmp_filename, "w");
#if defined(__GLIBC__) || defined(__WIN__) || O_CLOEXEC == 0
f = fopen(tmp_filename, "w" STR_O_CLOEXEC);
#else
{
int fd;
fd = open(tmp_filename, O_CREAT | O_TRUNC | O_CLOEXEC | O_WRONLY, 0640);
if (fd >= 0) {
f = fdopen(fd, "w");
}
else {
f = NULL;
}
}
#endif
if (f == NULL) {
buf_dump_status(STATUS_ERR,
"Cannot open '%s' for writing: %s",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment