diff options
author | Nirbhay Choubey <nirbhay@mariadb.com> | 2016-10-14 10:57:07 -0400 |
---|---|---|
committer | Nirbhay Choubey <nirbhay@mariadb.com> | 2016-10-14 10:57:07 -0400 |
commit | 308c666b604c7a5018b3b70203bf897c2354d449 (patch) | |
tree | 52f4bf4532acfcd20a3264361e788fc44d08d0b5 /mysys | |
parent | 04f92dde67a3d4f6fcbdbf65fdb63a54ff6761d8 (diff) | |
parent | eac8d95ffcdea7cd31d60d273e30cb3dfec66add (diff) | |
download | mariadb-git-308c666b604c7a5018b3b70203bf897c2354d449.tar.gz |
Merge remote-tracking branch 'origin/5.5' into 5.5-galera
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 52f61649bb3..cc1019365ac 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; |