summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlex Gorrod <alexg@wiredtiger.com>2016-04-08 16:43:54 +1000
committerAlex Gorrod <alexg@wiredtiger.com>2016-04-08 16:44:00 +1000
commit58fe2bfb350939a4b8c6e8ddd9735a49dc8d2db3 (patch)
treebdd3a9e05387de9afd784aa66e94c3d9b0f05ec5 /src
parent64bdc59ebc42b502ed76bf215048df0082de6060 (diff)
downloadmongo-58fe2bfb350939a4b8c6e8ddd9735a49dc8d2db3.tar.gz
Import wiredtiger-wiredtiger-2.8.0-140-g7bcf6fc.tar.gz from wiredtiger branch mongodb-3.4
ref: 94c171d..7bcf6fc SERVER-23588 mongod with WiredTiger won't start on Windows when built with --dbg=on --opt=off SERVER-23517 WiredTiger changes for MongoDB 3.3.5
Diffstat (limited to 'src')
-rw-r--r--src/third_party/wiredtiger/src/os_win/os_fs.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/third_party/wiredtiger/src/os_win/os_fs.c b/src/third_party/wiredtiger/src/os_win/os_fs.c
index 462773cb9fb..95c0ea40ce6 100644
--- a/src/third_party/wiredtiger/src/os_win/os_fs.c
+++ b/src/third_party/wiredtiger/src/os_win/os_fs.c
@@ -217,20 +217,20 @@ __win_handle_close(WT_SESSION_IMPL *session, WT_FH *fh)
{
WT_DECL_RET;
- if (fh->fp == NULL) {
+ if (fh->filehandle != INVALID_HANDLE_VALUE) {
/*
* We don't open Windows system handles when opening directories
* for flushing, as it is not necessary (or possible) to flush
* a directory on Windows. Confirm the file handle is set before
* attempting to close it.
*/
- if (fh->filehandle != INVALID_HANDLE_VALUE &&
- CloseHandle(fh->filehandle) == 0) {
+ if (CloseHandle(fh->filehandle) == 0) {
ret = __wt_getlasterror();
__wt_err(session, ret,
"%s: handle-close: CloseHandle", fh->name);
}
- } else {
+ }
+ if (fh->fp != NULL) {
/* If the stream was opened for writing, flush the file. */
if (F_ISSET(fh, WT_FH_FLUSH_ON_CLOSE) && fflush(fh->fp) != 0) {
ret = __wt_errno();
@@ -506,7 +506,7 @@ __win_handle_open(WT_SESSION_IMPL *session,
HANDLE filehandle, filehandle_secondary;
WT_CONNECTION_IMPL *conn;
WT_DECL_RET;
- int desired_access, f, fd;
+ int desired_access, f;
bool direct_io;
const char *stream_mode;
@@ -628,12 +628,10 @@ __win_handle_open(WT_SESSION_IMPL *session,
break;
}
if (stream_mode != NULL) {
- if ((fd = _open_osfhandle((intptr_t)filehandle, f)) == -1)
+ if ((fh->fp = fopen(name, stream_mode)) == NULL)
WT_ERR_MSG(session, __wt_errno(),
- "%s: handle-open: _open_osfhandle", name);
- if ((fh->fp = fdopen(fd, stream_mode)) == NULL)
- WT_ERR_MSG(session, __wt_errno(),
- "%s: handle-open: fdopen", name);
+ "%s: handle-open: fopen", name);
+
if (LF_ISSET(WT_STREAM_LINE_BUFFER))
__wt_stream_set_line_buffer(fh->fp);
}