diff --git a/contrib/win32/win32compat/fileio.c b/contrib/win32/win32compat/fileio.c index 6ab187b23..de9fbe874 100644 --- a/contrib/win32/win32compat/fileio.c +++ b/contrib/win32/win32compat/fileio.c @@ -343,7 +343,8 @@ createFile_flags_setup(int flags, u_short mode, struct createFile_flags* cf_flag switch (rwflags) { case O_RDONLY: cf_flags->dwDesiredAccess = GENERIC_READ; - cf_flags->dwShareMode = FILE_SHARE_READ; + /* refer to https://msdn.microsoft.com/en-us/library/windows/desktop/aa363874(v=vs.85).aspx */ + cf_flags->dwShareMode = FILE_SHARE_READ | FILE_SHARE_WRITE; break; case O_WRONLY: cf_flags->dwDesiredAccess = GENERIC_WRITE; diff --git a/contrib/win32/win32compat/w32log.c b/contrib/win32/win32compat/w32log.c index fe812237c..3483bea23 100644 --- a/contrib/win32/win32compat/w32log.c +++ b/contrib/win32/win32compat/w32log.c @@ -98,7 +98,7 @@ syslog(int priority, const char *format, const char *formatBuffer) return; GetLocalTime(&st); - r = snprintf(msgbufTimestamp, sizeof(msgbufTimestamp), "%d %02d:%02d:%02d %03d %s\n", + r = snprintf(msgbufTimestamp, sizeof(msgbufTimestamp), "%d %02d:%02d:%02d:%03d %s\n", GetCurrentProcessId(), st.wHour, st.wMinute, st.wSecond, st.wMilliseconds, formatBuffer); msgbufTimestamp[sizeof(msgbufTimestamp) - 1] = '\0';