[Box Backup-commit] COMMIT r1457 - box/chris/general/lib/win32

boxbackup-dev@fluffy.co.uk boxbackup-dev@fluffy.co.uk
Sat, 24 Mar 2007 19:23:16 +0000


Author: chris
Date: 2007-03-24 19:23:16 +0000 (Sat, 24 Mar 2007)
New Revision: 1457

Modified:
   box/chris/general/lib/win32/emu.cpp
Log:
Register our event source with the name passed to us, so that it goes
into the event logs.


Modified: box/chris/general/lib/win32/emu.cpp
===================================================================
--- box/chris/general/lib/win32/emu.cpp	2007-03-24 19:00:26 UTC (rev 1456)
+++ box/chris/general/lib/win32/emu.cpp	2007-03-24 19:23:16 UTC (rev 1457)
@@ -1345,13 +1345,17 @@
 	{
 	}
 
-	if (!AddEventSource("Box Backup", 0))
+	char* name = strdup(daemonName);
+	BOOL success = AddEventSource(name, 0);
+	free(name);
+
+	if (!success)
 	{
 		::syslog(LOG_ERR, "Failed to add our own event source");
 		return;
 	}
 
-	HANDLE newSyslogH = RegisterEventSource(NULL, "Box Backup");
+	HANDLE newSyslogH = RegisterEventSource(NULL, daemonName);
 	if (newSyslogH == NULL)
 	{
 		::syslog(LOG_ERR, "Failed to register our own event source: "