[Box Backup-commit] COMMIT r1588 - box/chris/merge/lib/common

boxbackup-dev@fluffy.co.uk boxbackup-dev@fluffy.co.uk
Sat, 28 Apr 2007 18:15:36 +0100


Author: chris
Date: 2007-04-28 18:15:36 +0100 (Sat, 28 Apr 2007)
New Revision: 1588

Modified:
   box/chris/merge/lib/common/Logging.cpp
   box/chris/merge/lib/common/Logging.h
Log:
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)


Modified: box/chris/merge/lib/common/Logging.cpp
===================================================================
--- box/chris/merge/lib/common/Logging.cpp	2007-04-28 17:14:27 UTC (rev 1587)
+++ box/chris/merge/lib/common/Logging.cpp	2007-04-28 17:15:36 UTC (rev 1588)
@@ -289,6 +289,7 @@
 
 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);
 }

Modified: box/chris/merge/lib/common/Logging.h
===================================================================
--- box/chris/merge/lib/common/Logging.h	2007-04-28 17:14:27 UTC (rev 1587)
+++ box/chris/merge/lib/common/Logging.h	2007-04-28 17:15:36 UTC (rev 1588)
@@ -128,6 +128,9 @@
 
 class Syslog : public Logger
 {
+	private:
+	std::string mName;
+
 	public:
 	Syslog();
 	virtual ~Syslog();