summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2014-02-07 18:16:19 +0000
committerChris Wilson <chris+github@qwirx.com>2014-02-07 18:16:19 +0000
commitae8c511c9cfd2a12e9e4c1199b080a2dfda22973 (patch)
tree46a834b7d8e861e1f5974a3f105fdd838af9e940 /lib
parentc3f2b249d7b87d0a20ff2c0f064245c5104907f7 (diff)
Close syslog before checking for files left open in tests.
Otherwise we might detect the opened syslog socket as a leaked file descriptor.
Diffstat (limited to 'lib')
-rw-r--r--lib/common/Logging.cpp5
-rw-r--r--lib/common/Logging.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/lib/common/Logging.cpp b/lib/common/Logging.cpp
index 7ce0dd3f..0a52fa5b 100644
--- a/lib/common/Logging.cpp
+++ b/lib/common/Logging.cpp
@@ -432,6 +432,11 @@ Syslog::Syslog() : mFacility(LOG_LOCAL6)
Syslog::~Syslog()
{
+ Shutdown();
+}
+
+void Syslog::Shutdown()
+{
::closelog();
}
diff --git a/lib/common/Logging.h b/lib/common/Logging.h
index 1074b7c3..3265d41d 100644
--- a/lib/common/Logging.h
+++ b/lib/common/Logging.h
@@ -274,6 +274,7 @@ class Syslog : public Logger
virtual const char* GetType() { return "Syslog"; }
virtual void SetProgramName(const std::string& rProgramName);
virtual void SetFacility(int facility);
+ virtual void Shutdown();
static int GetNamedFacility(const std::string& rFacility);
};