summaryrefslogtreecommitdiff
path: root/db/db.cpp
diff options
context:
space:
mode:
authorDwight <dwight@10gen.com>2011-06-28 16:22:25 -0400
committerDwight <dwight@10gen.com>2011-06-28 16:22:25 -0400
commitdd627743dd98e10523f981706cd944d3a7159eb7 (patch)
treed5b792a81325bd69e21e6d046ee27ba3a913bc98 /db/db.cpp
parent08fb2d17a4ef3c48c96e3b1c674e5fab3f5a0634 (diff)
downloadmongo-dd627743dd98e10523f981706cd944d3a7159eb7.tar.gz
crlf
Diffstat (limited to 'db/db.cpp')
-rw-r--r--db/db.cpp78
1 files changed, 39 insertions, 39 deletions
diff --git a/db/db.cpp b/db/db.cpp
index 95085499e7f..5f4639c9605 100644
--- a/db/db.cpp
+++ b/db/db.cpp
@@ -1178,49 +1178,49 @@ namespace mongo {
LPTOP_LEVEL_EXCEPTION_FILTER filtLast = 0;
::HANDLE standardOut = GetStdHandle(STD_OUTPUT_HANDLE);
- LONG WINAPI exceptionFilter(struct _EXCEPTION_POINTERS *ExceptionInfo) {
- {
- // given the severity of the event we write to console in addition to the --logFile
- // (rawOut writes to the logfile, if a special one were specified)
- DWORD written;
- WriteFile(standardOut, "unhandled windows exception\n", 20, &written, 0);
- FlushFileBuffers(standardOut);
- }
-
- DWORD ec = ExceptionInfo->ExceptionRecord->ExceptionCode;
- if( ec == EXCEPTION_ACCESS_VIOLATION ) {
- rawOut("access violation");
- }
- else {
- rawOut("unhandled windows exception");
- char buf[64];
- strcpy(buf, "ec=0x");
- _ui64toa(ec, buf+5, 16);
- rawOut(buf);
- }
- if( filtLast )
- return filtLast(ExceptionInfo);
- return EXCEPTION_EXECUTE_HANDLER;
- }
-
- // called by mongoAbort()
- extern void (*reportEventToSystem)(const char *msg);
- void reportEventToSystemImpl(const char *msg) {
+ LONG WINAPI exceptionFilter(struct _EXCEPTION_POINTERS *ExceptionInfo) {
+ {
+ // given the severity of the event we write to console in addition to the --logFile
+ // (rawOut writes to the logfile, if a special one were specified)
+ DWORD written;
+ WriteFile(standardOut, "unhandled windows exception\n", 20, &written, 0);
+ FlushFileBuffers(standardOut);
+ }
+
+ DWORD ec = ExceptionInfo->ExceptionRecord->ExceptionCode;
+ if( ec == EXCEPTION_ACCESS_VIOLATION ) {
+ rawOut("access violation");
+ }
+ else {
+ rawOut("unhandled windows exception");
+ char buf[64];
+ strcpy(buf, "ec=0x");
+ _ui64toa(ec, buf+5, 16);
+ rawOut(buf);
+ }
+ if( filtLast )
+ return filtLast(ExceptionInfo);
+ return EXCEPTION_EXECUTE_HANDLER;
+ }
+
+ // called by mongoAbort()
+ extern void (*reportEventToSystem)(const char *msg);
+ void reportEventToSystemImpl(const char *msg) {
static ::HANDLE hEventLog = RegisterEventSource( NULL, TEXT("mongod") );
if( hEventLog ) {
std::wstring s = toNativeString(msg);
LPCTSTR txt = s.c_str();
- BOOL ok = ReportEvent(
- hEventLog, EVENTLOG_ERROR_TYPE,
- 0, 0, NULL,
- 1,
- 0,
- &txt,
- 0);
- wassert(ok);
- }
- }
-
+ BOOL ok = ReportEvent(
+ hEventLog, EVENTLOG_ERROR_TYPE,
+ 0, 0, NULL,
+ 1,
+ 0,
+ &txt,
+ 0);
+ wassert(ok);
+ }
+ }
+
void myPurecallHandler() {
printStackTrace();
mongoAbort("pure virtual");