diff options
Diffstat (limited to 'util/log.cpp')
-rw-r--r-- | util/log.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/util/log.cpp b/util/log.cpp index bfd9154..334c66b 100644 --- a/util/log.cpp +++ b/util/log.cpp @@ -83,7 +83,7 @@ namespace mongo { } - FILE* tmp = fopen(_path.c_str(), (_append ? "a" : "w")); + FILE* tmp = freopen(_path.c_str(), (_append ? "a" : "w"), stdout); if (!tmp){ cerr << "can't open: " << _path.c_str() << " for log file" << endl; dbexit( EXIT_BADOPTIONS ); @@ -92,10 +92,6 @@ namespace mongo { Logstream::setLogFile(tmp); // after this point no thread will be using old file - if (_file){ - fclose(_file); - } - _file = tmp; _opened = time(0); } |