summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2016-09-29 12:59:51 +0200
committerSergei Golubchik <serg@mariadb.org>2016-09-29 12:59:51 +0200
commit2ede40e67e41f294a32ba3e4797bc6fc4c070217 (patch)
treeebc7c92dfe7b4f007abd0b331b407ccc61b19578 /mysys
parentad2076945062f7f6d29752641048071229435391 (diff)
parenta3f11f75499ffc867aefe24c80a9c57fbdfb8ac2 (diff)
downloadmariadb-git-2ede40e67e41f294a32ba3e4797bc6fc4c070217.tar.gz
Merge branch '10.0' into 10.1
Diffstat (limited to 'mysys')
-rw-r--r--mysys/my_fopen.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/mysys/my_fopen.c b/mysys/my_fopen.c
index 1fa3f9b9b8f..2ac033c8264 100644
--- a/mysys/my_fopen.c
+++ b/mysys/my_fopen.c
@@ -101,6 +101,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)
@@ -111,15 +112,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;