Commit 4c810790 authored by Davi Arnaut's avatar Davi Arnaut

Bug#51023: Mysql server crashes on SIGHUP and destroys InnoDB files

WIN32 compilation fixes: define ETIMEDOUT only if not available and
fix typos and add a missing parameter.
parent 78b6ca55
...@@ -126,7 +126,9 @@ struct tm *gmtime_r(const time_t *timep,struct tm *tmp); ...@@ -126,7 +126,9 @@ struct tm *gmtime_r(const time_t *timep,struct tm *tmp);
void pthread_exit(void *a); /* was #define pthread_exit(A) ExitThread(A)*/ void pthread_exit(void *a); /* was #define pthread_exit(A) ExitThread(A)*/
#define ETIMEDOUT 145 /* Win32 doesn't have this */ #ifndef ETIMEDOUT
#define ETIMEDOUT 145 /* Win32 might not have this */
#endif
#define getpid() GetCurrentThreadId() #define getpid() GetCurrentThreadId()
#define HAVE_LOCALTIME_R 1 #define HAVE_LOCALTIME_R 1
#define _REENTRANT 1 #define _REENTRANT 1
......
...@@ -103,17 +103,17 @@ FILE *my_fopen(const char *filename, int flags, myf MyFlags) ...@@ -103,17 +103,17 @@ FILE *my_fopen(const char *filename, int flags, myf MyFlags)
#if defined(_WIN32) #if defined(_WIN32)
static FILE *my_win_freopen(const char *path, FILE *stream) static FILE *my_win_freopen(const char *path, const char *mode, FILE *stream)
{ {
int handle_fd, fd= _fileno(stream); int handle_fd, fd= _fileno(stream);
HANDLE osfh; HANDLE osfh;
DBUG_ASSERT(filename && stream); DBUG_ASSERT(path && stream);
/* Services don't have stdout/stderr on Windows, so _fileno returns -1. */ /* Services don't have stdout/stderr on Windows, so _fileno returns -1. */
if (fd < 0) if (fd < 0)
{ {
if (!freopen(filename, mode, stream)) if (!freopen(path, mode, stream))
return NULL; return NULL;
fd= _fileno(stream); fd= _fileno(stream);
......
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