summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2007-04-28 17:15:36 +0000
committerChris Wilson <chris+github@qwirx.com>2007-04-28 17:15:36 +0000
commit9362fdfa7b8f2639a2ec5290b38e2e9c9ea8483b (patch)
tree12c19910644a4b4a0503cd461963c82c625a2ea5
parentd7f3062292dd3b859c6d2632945b6ef6f102a116 (diff)
Keep a copy of the program name, in case the original goes away, which
causes syslog() to write nonsense for the program name. (refs #3)
-rw-r--r--lib/common/Logging.cpp3
-rw-r--r--lib/common/Logging.h3
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/common/Logging.cpp b/lib/common/Logging.cpp
index bb728183..5f0a2f8f 100644
--- a/lib/common/Logging.cpp
+++ b/lib/common/Logging.cpp
@@ -289,6 +289,7 @@ Syslog::~Syslog()
void Syslog::SetProgramName(const std::string& rProgramName)
{
+ mName = rProgramName;
::closelog();
- ::openlog(rProgramName.c_str(), LOG_PID, LOG_LOCAL6);
+ ::openlog(mName.c_str(), LOG_PID, LOG_LOCAL6);
}
diff --git a/lib/common/Logging.h b/lib/common/Logging.h
index 65018632..aea488a5 100644
--- a/lib/common/Logging.h
+++ b/lib/common/Logging.h
@@ -128,6 +128,9 @@ class Console : public Logger
class Syslog : public Logger
{
+ private:
+ std::string mName;
+
public:
Syslog();
virtual ~Syslog();