summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2010-05-10 11:26:08 -0400
committerEliot Horowitz <eliot@10gen.com>2010-05-10 11:59:02 -0400
commit8fa4644f25cb4416a84a40187151fc2b17abc979 (patch)
tree7122363e64965f3c896208ba2d604b3eced61039
parent1b4e06c64eecb8bb80ee6aacf311457fcf9e375d (diff)
downloadmongo-8fa4644f25cb4416a84a40187151fc2b17abc979.tar.gz
print filename for windows flush failure SERVER-1107
-rw-r--r--util/mmap.h1
-rw-r--r--util/mmap_posix.cpp1
-rw-r--r--util/mmap_win.cpp11
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;
}
}
}