diff options
author | Sergei Golubchik <serg@mariadb.org> | 2016-09-29 12:31:46 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2016-09-29 12:31:46 +0200 |
commit | a3f11f75499ffc867aefe24c80a9c57fbdfb8ac2 (patch) | |
tree | 3b031b05ba80e851983342aff066c1d1315a3cdb /mysys | |
parent | 23af6f5942e7235a7c14a36cb8dd0d2796b5ef37 (diff) | |
parent | 7497ebf8a49bfe30bb4110f2ac20a30f804b7946 (diff) | |
download | mariadb-git-a3f11f75499ffc867aefe24c80a9c57fbdfb8ac2.tar.gz |
Merge branch '5.5' into 10.0
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/my_fopen.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mysys/my_fopen.c b/mysys/my_fopen.c index ede434f2c32..b6027a99c90 100644 --- a/mysys/my_fopen.c +++ b/mysys/my_fopen.c @@ -102,6 +102,7 @@ static FILE *my_win_freopen(const char *path, const char *mode, FILE *stream) HANDLE osfh; DBUG_ASSERT(path && stream); + DBUG_ASSERT(strchr(mode, 'a')); /* We use FILE_APPEND_DATA below */ /* Services don't have stdout/stderr on Windows, so _fileno returns -1. */ if (fd < 0) @@ -112,15 +113,14 @@ static FILE *my_win_freopen(const char *path, const char *mode, FILE *stream) fd= _fileno(stream); } - if ((osfh= CreateFile(path, GENERIC_READ | GENERIC_WRITE, + if ((osfh= CreateFile(path, GENERIC_READ | FILE_APPEND_DATA, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) return NULL; - if ((handle_fd= _open_osfhandle((intptr_t)osfh, - _O_APPEND | _O_TEXT)) == -1) + if ((handle_fd= _open_osfhandle((intptr_t)osfh, _O_TEXT)) == -1) { CloseHandle(osfh); return NULL; |