File tree Expand file tree Collapse file tree 5 files changed +35
-4
lines changed Expand file tree Collapse file tree 5 files changed +35
-4
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ ENDIF()
26
26
OPTION (WITH_WSREP "WSREP replication API (to use, e.g. Galera Replication library)" ${with_wsrep_default} )
27
27
28
28
# Set the patch version
29
- SET (WSREP_PATCH_VERSION "21 " )
29
+ SET (WSREP_PATCH_VERSION "23 " )
30
30
31
31
# Obtain wsrep API version
32
32
FILE (STRINGS "${MySQL_SOURCE_DIR} /wsrep/wsrep_api.h" WSREP_API_VERSION
Original file line number Diff line number Diff line change @@ -593,6 +593,11 @@ typedef SOCKET_SIZE_TYPE size_socket;
593
593
#ifndef O_CLOEXEC
594
594
#define O_CLOEXEC 0
595
595
#endif
596
+ #ifdef __GLIBC__
597
+ #define STR_O_CLOEXEC " e"
598
+ #else
599
+ #define STR_O_CLOEXEC " "
600
+ #endif
596
601
#ifndef SOCK_CLOEXEC
597
602
#define SOCK_CLOEXEC 0
598
603
#endif
Original file line number Diff line number Diff line change @@ -216,7 +216,20 @@ buf_dump(
216
216
buf_dump_status (STATUS_NOTICE, " Dumping buffer pool(s) to %s" ,
217
217
full_filename);
218
218
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
220
233
if (f == NULL ) {
221
234
buf_dump_status (STATUS_ERR,
222
235
" Cannot open '%s' for writing: %s" ,
Original file line number Diff line number Diff line change @@ -3851,7 +3851,7 @@ os_aio_native_aio_supported(void)
3851
3851
3852
3852
strcpy (name + dirnamelen, " ib_logfile0" );
3853
3853
3854
- fd = ::open (name, O_RDONLY);
3854
+ fd = ::open (name, O_RDONLY | O_CLOEXEC );
3855
3855
3856
3856
if (fd == -1 ) {
3857
3857
Original file line number Diff line number Diff line change @@ -216,7 +216,20 @@ buf_dump(
216
216
buf_dump_status (STATUS_NOTICE, " Dumping buffer pool(s) to %s" ,
217
217
full_filename);
218
218
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
220
233
if (f == NULL ) {
221
234
buf_dump_status (STATUS_ERR,
222
235
" Cannot open '%s' for writing: %s" ,
You can’t perform that action at this time.
0 commit comments