diff options
author | Keith Bostic <keith@wiredtiger.com> | 2016-04-22 12:53:21 -0400 |
---|---|---|
committer | Keith Bostic <keith@wiredtiger.com> | 2016-04-22 12:53:21 -0400 |
commit | 93fe33bd2473e384bd9c52ca4f347af2961d24c9 (patch) | |
tree | 83348d9a1b6564247f2dd9278d232986fd400677 /src/btree | |
parent | 3a6488a12d339b1bb8a1ff3eb015f08327be855a (diff) | |
download | mongo-93fe33bd2473e384bd9c52ca4f347af2961d24c9.tar.gz |
WT-2579: in-memory configurations break debugging support
In-memory configurations break the debugging support which wants to
write (potentially very large) chunks of information to files, for
example, dumping disk images, or in-memory pages, or the cache, and
writing that information into memory is useless.
Quit trying to make this work, revert the debugging functions to use
stdio calls directly.
Diffstat (limited to 'src/btree')
-rw-r--r-- | src/btree/bt_debug.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/btree/bt_debug.c b/src/btree/bt_debug.c index 946dcc9cf98..bd5970ecf86 100644 --- a/src/btree/bt_debug.c +++ b/src/btree/bt_debug.c @@ -19,7 +19,7 @@ typedef struct { * When using the standard event handlers, the debugging output has to * do its own message handling because its output isn't line-oriented. */ - WT_FSTREAM *fs; /* Output file stream */ + FILE *fp; WT_ITEM *msg; /* Buffered message */ WT_ITEM *tmp; /* Temporary space */ @@ -97,8 +97,11 @@ __debug_config(WT_SESSION_IMPL *session, WT_DBG *ds, const char *ofile) if (ofile == NULL) return (__wt_scr_alloc(session, 512, &ds->msg)); - return (__wt_fopen(session, ofile, WT_OPEN_CREATE, - WT_STREAM_LINE_BUFFER | WT_STREAM_WRITE, &ds->fs)); + if ((ds->fp = fopen(ofile, "w")) == NULL) + return (EIO); + __wt_stream_set_line_buffer(ds->fp); + + return (0); } /* @@ -127,7 +130,8 @@ __dmsg_wrapup(WT_DBG *ds) } /* Close any file we opened. */ - (void)__wt_fclose(session, &ds->fs); + if (ds->fp != NULL) + (void)fclose(ds->fp); } /* @@ -152,7 +156,7 @@ __dmsg(WT_DBG *ds, const char *fmt, ...) * the output chunk, and pass it to the event handler once we see a * terminating newline. */ - if (ds->fs == NULL) { + if (ds->fp == NULL) { msg = ds->msg; for (;;) { p = (char *)msg->mem + msg->size; @@ -184,7 +188,7 @@ __dmsg(WT_DBG *ds, const char *fmt, ...) } } else { va_start(ap, fmt); - (void)__wt_vfprintf(session, ds->fs, fmt, ap); + (void)vfprintf(ds->fp, fmt, ap); va_end(ap); } } |