File tree Expand file tree Collapse file tree 3 files changed +8
-3
lines changed Expand file tree Collapse file tree 3 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -591,6 +591,11 @@ typedef SOCKET_SIZE_TYPE size_socket;
591
591
#ifndef O_CLOEXEC
592
592
#define O_CLOEXEC 0
593
593
#endif
594
+ #ifdef __GLIBC__
595
+ #define STR_O_CLOEXEC " e"
596
+ #else
597
+ #define STR_O_CLOEXEC " "
598
+ #endif
594
599
#ifndef SOCK_CLOEXEC
595
600
#define SOCK_CLOEXEC 0
596
601
#endif
Original file line number Diff line number Diff line change @@ -275,7 +275,7 @@ buf_dump(
275
275
buf_dump_status (STATUS_INFO, " Dumping buffer pool(s) to %s" ,
276
276
full_filename);
277
277
278
- f = fopen (tmp_filename, " w" );
278
+ f = fopen (tmp_filename, " w" STR_O_CLOEXEC );
279
279
if (f == NULL ) {
280
280
buf_dump_status (STATUS_ERR,
281
281
" Cannot open '%s' for writing: %s" ,
@@ -516,7 +516,7 @@ buf_load()
516
516
buf_load_status (STATUS_INFO,
517
517
" Loading buffer pool(s) from %s" , full_filename);
518
518
519
- f = fopen (full_filename, " r" );
519
+ f = fopen (full_filename, " r" STR_O_CLOEXEC );
520
520
if (f == NULL ) {
521
521
buf_load_status (STATUS_INFO,
522
522
" Cannot open '%s' for reading: %s" ,
Original file line number Diff line number Diff line change @@ -1043,7 +1043,7 @@ char*
1043
1043
RemoteDatafile::read_link_file (
1044
1044
const char * link_filepath)
1045
1045
{
1046
- FILE* file = fopen (link_filepath, " r+b" );
1046
+ FILE* file = fopen (link_filepath, " r+b" STR_O_CLOEXEC );
1047
1047
if (file == NULL ) {
1048
1048
return (NULL );
1049
1049
}
You can’t perform that action at this time.
0 commit comments