diff --git a/extra/comp_err.c b/extra/comp_err.c index 2b84f1cbca7..40562aeae5d 100644 --- a/extra/comp_err.c +++ b/extra/comp_err.c @@ -494,7 +494,7 @@ static uint parse_input_file(const char *file_name, struct errors **top_error, section_start= er_offset; section_count= 0; - if (!(file= my_fopen(file_name, O_RDONLY | O_SHARE, MYF(MY_WME)))) + if (!(file= my_fopen(file_name, O_RDONLY | O_TEXT | O_SHARE, MYF(MY_WME)))) DBUG_RETURN(0); while ((str= fgets(buff, sizeof(buff), file))) diff --git a/include/my_global.h b/include/my_global.h index a849597f468..6b4ed7dbfcc 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -598,6 +598,9 @@ typedef SOCKET_SIZE_TYPE size_socket; #else #define HAVE_SOCK_CLOEXEC #endif +#ifndef O_TEXT +#define O_TEXT 0 +#endif /* additional file share flags for win32 */ #ifdef _WIN32 diff --git a/mysys/my_fopen.c b/mysys/my_fopen.c index 25b492846e5..2bc1da52d66 100644 --- a/mysys/my_fopen.c +++ b/mysys/my_fopen.c @@ -291,6 +291,8 @@ static void make_ftype(register char * to, register int flag) if (flag & FILE_BINARY) *to++='b'; + else if (flag & O_TEXT) + *to++= 't'; if (O_CLOEXEC) *to++= 'e';