diff options
author | Davi Arnaut <davi.arnaut@oracle.com> | 2011-01-07 17:28:06 -0200 |
---|---|---|
committer | Davi Arnaut <davi.arnaut@oracle.com> | 2011-01-07 17:28:06 -0200 |
commit | 844d6ed4b26e676418eb3867682fc1a2949e4706 (patch) | |
tree | 94dc73910b959984185444daac93cf4302c96705 | |
parent | 998065c3a6f3d65e88c3926b31088a245f77406d (diff) | |
download | mariadb-git-844d6ed4b26e676418eb3867682fc1a2949e4706.tar.gz |
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.
-rw-r--r-- | include/my_pthread.h | 4 | ||||
-rw-r--r-- | mysys/my_fopen.c | 6 |
2 files changed, 6 insertions, 4 deletions
diff --git a/include/my_pthread.h b/include/my_pthread.h index a7e4ea25064..3880511da2d 100644 --- a/include/my_pthread.h +++ b/include/my_pthread.h @@ -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)*/ -#define ETIMEDOUT 145 /* Win32 doesn't have this */ +#ifndef ETIMEDOUT +#define ETIMEDOUT 145 /* Win32 might not have this */ +#endif #define getpid() GetCurrentThreadId() #define HAVE_LOCALTIME_R 1 #define _REENTRANT 1 diff --git a/mysys/my_fopen.c b/mysys/my_fopen.c index a822b63dd63..b8373ecb3ab 100644 --- a/mysys/my_fopen.c +++ b/mysys/my_fopen.c @@ -103,17 +103,17 @@ FILE *my_fopen(const char *filename, int flags, myf MyFlags) #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); HANDLE osfh; - DBUG_ASSERT(filename && stream); + DBUG_ASSERT(path && stream); /* Services don't have stdout/stderr on Windows, so _fileno returns -1. */ if (fd < 0) { - if (!freopen(filename, mode, stream)) + if (!freopen(path, mode, stream)) return NULL; fd= _fileno(stream); |