diff options
-rw-r--r-- | util/mmap.h | 1 | ||||
-rw-r--r-- | util/mmap_posix.cpp | 1 | ||||
-rw-r--r-- | util/mmap_win.cpp | 11 |
3 files changed, 8 insertions, 5 deletions
diff --git a/util/mmap.h b/util/mmap.h index 947364beb19..c3133e47f0c 100644 --- a/util/mmap.h +++ b/util/mmap.h @@ -61,6 +61,7 @@ namespace mongo { HANDLE maphandle; void *view; long len; + string _filename; }; void printMemInfo( const char * where ); diff --git a/util/mmap_posix.cpp b/util/mmap_posix.cpp index 836373d36bc..a5caf8cbec4 100644 --- a/util/mmap_posix.cpp +++ b/util/mmap_posix.cpp @@ -51,6 +51,7 @@ namespace mongo { void* MemoryMappedFile::map(const char *filename, long &length, int options) { // length may be updated by callee. + _filename = filename; theFileAllocator().allocateAsap( filename, length ); len = length; diff --git a/util/mmap_win.cpp b/util/mmap_win.cpp index d831d664eb8..6168d9d2f61 100644 --- a/util/mmap_win.cpp +++ b/util/mmap_win.cpp @@ -46,13 +46,14 @@ namespace mongo { buf << s; return buf.str(); } - + unsigned mapped = 0; - void* MemoryMappedFile::map(const char *_filename, long &length, int options) { + void* MemoryMappedFile::map(const char *filenameIn, long &length, int options) { + _filename = filenameIn; /* big hack here: Babble uses db names with colons. doesn't seem to work on windows. temporary perhaps. */ char filename[256]; - strncpy(filename, _filename, 255); + strncpy(filename, filenameIn, 255); filename[255] = 0; { size_t len = strlen( filename ); @@ -107,13 +108,13 @@ namespace mongo { bool success = FlushViewOfFile(view, 0); // 0 means whole mapping if (!success){ int err = GetLastError(); - out() << "FlushViewOfFile failed " << err << endl; + out() << "FlushViewOfFile failed " << err << " file: " << _filename << endl; } success = FlushFileBuffers(fd); if (!success){ int err = GetLastError(); - out() << "FlushFileBuffers failed " << err << endl; + out() << "FlushFileBuffers failed " << err << " file: " << _filename << endl; } } } |