diff options
author | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2015-06-20 00:22:50 -0400 |
---|---|---|
committer | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2015-06-20 10:56:02 -0400 |
commit | 9c2ed42daa8fbbef4a919c21ec564e2db55e8d60 (patch) | |
tree | 3814f79c10d7b490948d8cb7b112ac1dd41ceff1 /src/mongo/util/processinfo.cpp | |
parent | 01965cf52bce6976637ecb8f4a622aeb05ab256a (diff) | |
download | mongo-9c2ed42daa8fbbef4a919c21ec564e2db55e8d60.tar.gz |
SERVER-18579: Clang-Format - reformat code, no comment reflow
Diffstat (limited to 'src/mongo/util/processinfo.cpp')
-rw-r--r-- | src/mongo/util/processinfo.cpp | 64 |
1 files changed, 31 insertions, 33 deletions
diff --git a/src/mongo/util/processinfo.cpp b/src/mongo/util/processinfo.cpp index 53e954d44da..5a0e8dc798c 100644 --- a/src/mongo/util/processinfo.cpp +++ b/src/mongo/util/processinfo.cpp @@ -43,47 +43,45 @@ using namespace std; namespace mongo { - class PidFileWiper { - public: - ~PidFileWiper() { - if (path.empty()) { - return; - } - - ofstream out( path.c_str() , ios_base::out ); - out.close(); +class PidFileWiper { +public: + ~PidFileWiper() { + if (path.empty()) { + return; } - bool write( const string& p ) { - path = p; - ofstream out( path.c_str() , ios_base::out ); - out << ProcessId::getCurrent() << endl; - return out.good(); - } - - string path; - } pidFileWiper; + ofstream out(path.c_str(), ios_base::out); + out.close(); + } - bool writePidFile( const string& path ) { - bool e = pidFileWiper.write( path ); - if (!e) { - log() << "ERROR: Cannot write pid file to " << path - << ": "<< strerror(errno); - } - return e; + bool write(const string& p) { + path = p; + ofstream out(path.c_str(), ios_base::out); + out << ProcessId::getCurrent() << endl; + return out.good(); } - ProcessInfo::SystemInfo* ProcessInfo::systemInfo = NULL; + string path; +} pidFileWiper; - void ProcessInfo::initializeSystemInfo() { - if (systemInfo == NULL) { - systemInfo = new SystemInfo(); - } +bool writePidFile(const string& path) { + bool e = pidFileWiper.write(path); + if (!e) { + log() << "ERROR: Cannot write pid file to " << path << ": " << strerror(errno); } + return e; +} + +ProcessInfo::SystemInfo* ProcessInfo::systemInfo = NULL; - MONGO_INITIALIZER(SystemInfo)(InitializerContext* context) { - ProcessInfo::initializeSystemInfo(); - return Status::OK(); +void ProcessInfo::initializeSystemInfo() { + if (systemInfo == NULL) { + systemInfo = new SystemInfo(); } +} +MONGO_INITIALIZER(SystemInfo)(InitializerContext* context) { + ProcessInfo::initializeSystemInfo(); + return Status::OK(); +} } |